Resources can be aggregated both within and between patches. In this article, we examine how aggregation at these different scales influences the behavior and performance of foragers. We developed an optimal foraging model of the foraging behavior of the parasitoid wasp Cotesia rubecula parasitizing the larvae of the cabbage butterfly Pieris rapae. The optimal behavior was found using stochasti...