Long‐term environmental stochasticity is known to affect the adaptive evolution of life history traits. In stochastic environments, there are two different levels of behavioral optimization, as follows: Level 1, the optimal strategy under an intrageneration stochastic environment and Level 2, the optimal strategy under an intergeneration stochastic environment. This article presents a simple optimal foraging model under predation risks and verified the effect of behavioral optimization on the foraging time ratio. In this model, foragers are exposed to predation risks during foraging but are safe if they stay in their nests without any food. The foraging time allocation strategies that optimize the geometric mean fitness (Level 2) were compared with the arithmetic mean fitness (Level 1) to verify the effects of intergenerational stochasticity, whereby there is an alternation in good/bad environments across generations. As in previous studies, risk‐averse strategies (a shorter foraging time is adopted for Level 2 than for Level 1) were commonly observed using this model. Unexpectedly, the model showed a tendency toward a preference for risk‐prone strategies. This qualitative difference became prominent when food was abundant and the maximum energy reserves were small. Theoretical studies have shown that risk‐averse strategies are commonly adopted during food shortages and result in starvation. However, the current results indicate that risk‐prone strategies may become optimal under a limited reserve capacity. Thus, the optimal strategy depends not only on the individual status and environmental conditions, but also on the detailed selection regimes.