Family planning in parasitoids: adaptive patterns of progeny and sex allocation.