Expansion and intensification of human land use represents the major cause of habitat fragmentation. Such fragmentation can have dramatic consequences on species richness and trophic interactions within food webs. Although the associated ecological consequences have been studied by several authors, the evolutionary effects on interacting species have received little research attention. Using a genetic algorithm, we quantified how habitat fragmentation and environmental variability affect the optimal reproductive strategies of parasitic wasps foraging for hosts. As observed in real animal species, the model is based on the existence of a negative trade-off between survival and reproduction resulting from competitive allocation of resources to either somatic maintenance or egg production. We also asked to what degree plasticity along this trade-off would be optimal, when plasticity is costly. We found that habitat fragmentation can indeed have strong effects on the reproductive strategies adopted by parasitoids. With increasing habitat fragmentation animals should invest in greater longevity with lower fecundity; yet, especially in unpredictable environments, some level of phenotypic plasticity should be selected for. Other consequences in terms of learning ability of foraging animals were also observed. The evolutionary consequences of these results are discussed.