This callback specifies that a code block is providing logic for an individual to choose a mate. The first parent is
chosen based on fitness values, then this callback is called to determine the second parent (if no callback is specified, it is chosen
randomly proportional to fitness). The callback code should return a vector of weights specifying the proportional probability of each individual in the population
being the second parent (including the first parent, as selfing is possible). Alternatively, it could return an Individual
object
referring to the individual chosen as the second parent. Returning a numeric 0
tells SLiM that no mate could be found. Lastly, returning
NULL
tells SLiM to use the default weights
vector, which is the same as just returning weights
but is more efficient.
see SLiM Manual: page 599
mateChoice(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.
None
Global variables available in reproduction callbacks:
The parent already chosen (the female, in sexual simulations)
One genome of the parent already chosen
The other genome of the parent already chosen
The subpopulation into which the offspring will be placed
The subpopulation from which the parents are being chosen
The standard fitness-based weights for all individuals
This is documentation for a function in the SLiM software, and has been modified from the official manual, which can be found here: http://benhaller.com/slim/SLiM_Manual.pdf. This documentation is Copyright © 2016-2020 Philipp Messer. All rights reserved. More information about SLiM can be found on the official website: https://messerlab.org/slim/
Other callbacks:
early()
,
first()
,
fitnessEffect()
,
fitness()
,
initialize()
,
interaction()
,
late()
,
modifyChild()
,
mutationEffect()
,
mutation()
,
recombination()
,
reproduction()
,
slim_callbacks()
,
survival()
slim_block(mateChoice(p2), {
## in subpopulation 2, high fitness individuals are preferred
return(weights^2)
})
#> A slimr_block:
#> <slimr_script[1]>
#> block_1:1:1 mateChoice(p2) {
#> return(weights^2);
#> }