Skip to main content
. 2019 Jan 18;36(3):632–637. doi: 10.1093/molbev/msy228

Fig. 1.

Fig. 1.

A comparison of the generation cycles in WF models (left) versus nonWF models (right). Note that nonWF models have a viability/survival selection phase, immediately after fitness value recalculation, whereas in WF models fitness influences mating success and there is no concept of mortality-based selection. Events and callbacks are shown in red; these are points in the generation cycle when SLiM will call out to the script to provide custom behavior. So-called early() and late() events provide commonly used points in the generation cycle when the model script can intervene in SLiM’s operation, toward the beginning and the end of each generation respectively, to do model-specific tasks—generate output, handle interactions between individuals, move individuals in space, and so forth. As this figure illustrates, in WF models early() events come before offspring generation and late() events come after; in nonWF models, early() events come after offspring generation, whereas late() events, by virtue of being at the end of the generation cycle, in effect come before offspring generation (when it occurs at the beginning of the next generation). Callbacks, on the other hand, allow the script to override specific aspects of SLiM’s behavior, such as choosing mates, customizing generated offspring, calculating fitness effects, or generating custom recombination breakpoints. Most of these callbacks exist in both WF and nonWF models, but mateChoice() callbacks exist only in WF models, whereas reproduction() callbacks are only in nonWF models and handle mate choice as well as other reproduction-related duties.