Documentation for SLiM function recalculateFitness
, which is a method of
the SLiM class Species
.
Note that the R function is a stub, it does not do anything in R (except bring
up this documentation). It will only do
anything useful when used inside a slim_block
function further
nested in a slim_script
function call, where it will be translated into valid SLiM code as part of a
full SLiM script.
recalculateFitness(tick)
An object of type null or integer. Must be of length 1 (a
singleton). The default value is NULL
. See details for description.
An object of type void.
Documentation for this function can be found in the official SLiM manual: page 725.
Force an immediate recalculation of fitness values for all individuals in all subpopulations. Normally fitness values are calculated at a fixed point in each tick, and those values are cached and used until the next recalculation. If simulation parameters are changed in script in a way that affects fitness calculations, and if you wish those changes to take effect immediately rather than taking effect at the next automatic recalculation, you may call recalculateFitness() to force an immediate recalculation and recache. The optional parameter tick provides the tick for which mutationEffect() and fitnessEffect() callbacks should be selected; if it is NULL (the default), the current tick value for the simulation, community.tick, is used. If you call recalculateFitness() in an early() event in a WF model, you may wish this to be community.tick - 1 in order to utilize the mutationEffect() and fitnessEffect() callbacks for the previous tick, as if the changes that you have made to fitnessinfluencing parameters were already in effect at the end of the previous tick when the new generation was first created and evaluated (usually it is simpler to just make such changes in a late() event instead, however, in which case calling recalculateFitness() is probably not necessary at all since fitness values will be recalculated immediately afterwards). Regardless of the value supplied for tick here, community.tick inside callbacks will report the true tick number, so if your callbacks consult that parameter in order to create tick-specific fitness effects you will need to handle the discrepancy somehow. (Similar considerations apply for nonWF models that call recalculateFitness() in a late() event, which is also not advisable in general.) After this call, the fitness values used for all purposes in SLiM will be the newly calculated values. Calling this method will trigger the calling of any enabled and applicable mutationEffect() and fitnessEffect() callbacks, so this is quite a heavyweight operation; you should think carefully about what side effects might result (which is why fitness recalculation does not just occur automatically after changes that might affect fitness values).
This is documentation for a function in the SLiM software, and has been reproduced 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 Species:
Sp
,
addSubpopSplit()
,
addSubpop()
,
countOfMutationsOfType()
,
individualsWithPedigreeIDs()
,
killIndividuals()
,
mutationCounts()
,
mutationFrequencies()
,
mutationsOfType()
,
outputFixedMutations()
,
outputFull()
,
outputMutations()
,
readFromPopulationFile()
,
registerFitnessEffectCallback()
,
registerMateChoiceCallback()
,
registerModifyChildCallback()
,
registerMutationCallback()
,
registerMutationEffectCallback()
,
registerRecombinationCallback()
,
registerReproductionCallback()
,
registerSurvivalCallback()
,
simulationFinished()
,
skipTick()
,
subsetMutations()
,
treeSeqCoalesced()
,
treeSeqOutput()
,
treeSeqRememberIndividuals()
,
treeSeqSimplify()