This callback specifies that a code block is providing logic to determine the
strength of interaction between individuals. It should return the strength of the interaction
as a numeric value. You must explicitly use return(value)
at the end of the code block.
For more information on how to use interaction()
callback
see SLiM Manual: page 604
interaction(int_type_id, subpop_id)
The id of the InteractionType to apply this callback to. Can be an integer 1, 2, etc., or character "i1", "i2", etc.
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 distance from receiver to exerter, in spatial simulations; NAN otherwise
The default interaction strength calculated by the interaction function
The individual receiving the interaction (an object of class Individual)
The individual exerting the interaction (an object of class Individual)
The subpopulation in which the receiver and exerter live
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()
,
late()
,
mateChoice()
,
modifyChild()
,
mutationEffect()
,
mutation()
,
recombination()
,
reproduction()
,
slim_callbacks()
,
survival()
slim_block(interaction(), {
# custom interaction strength as a function of values held in exerter and receiver tagF element.
return(dnorm(exerter.tagF, receiver.tagF, 0.1) / dnorm(0, 0, 0.1))
})
#> A slimr_block:
#> <slimr_script[1]>
#> block_1:1:1 interaction() {
#> return(dnorm(exerter.tagF, receiver.tagF, 0.1)/dnorm(0, 0, 0.1));
#> }