This callback specifies that a code block is providing logic for the production of offspring. It is called once per individual for each generation in which it is active, and is expected to add new individuals to the simulation using the SLiM functions provided for that purpose. This is only used in "nonWF" simulations. For more information on how to use reproduction() callback see SLiM Manual: page 606

reproduction(subpop_id, sex)

Arguments

subpop_id

The id(s) of the subpopulation(s) to which this callback should apply. Can be an integer 1, 2, etc., or character "p1", "p2", etc.

sex

The sex of the individuals to apply this callback to.

Value

None

Details

Global variables available in reproduction callbacks:

individual

The focal individual that is expected to reproduce

genome1

One genome of the focal individual

genome2

The other genome of the focal individual

subpop

The subpopulation to which the focal individual belongs

Author

Benjamin C Haller (bhaller@benhaller.com) and Philipp W Messer (messer@cornell.edu)

Examples

slim_block(reproduction(), {

  subpop.addCrossed(individual, subpop.sampleIndividuals(1))

})
#> A slimr_block:
#> <slimr_script[1]>
#> block_1:1:1 reproduction() {
#>     subpop.addCrossed(individual, subpop.sampleIndividuals(1));
#> }