Nemo
2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
|
Performs breeding and migration in one, migration rates are backward rates. More...
#include <LCEcomposite.h>
Public Member Functions | |
LCE_Breed_Disperse () | |
virtual | ~LCE_Breed_Disperse () |
void | do_breed_disperse () |
void | do_breed_disperse_propagule () |
unsigned int | numFemOffspring (Patch *patch) |
unsigned int | numFemOffspring_colonizers (Patch *patch) |
The number of females produced in case a max number of colonizers was specified. More... | |
unsigned int | numMalOffspring_notrandom (Patch *patch) |
The number of males produced is always zero when the mating system is not random mating. More... | |
unsigned int | numMalOffspring_random (Patch *patch) |
unsigned int | numMalOffspring_random_colonizers (Patch *patch) |
Growth Functions | |
unsigned int | instantGrowth (Patch *patch, sex_t SEX) |
The number of offspring produced corresponds to the carrying capacity of the patch. More... | |
unsigned int | logisticGrowth (Patch *patch, sex_t SEX) |
The number of offspring produced is given by the logistic growth function. More... | |
unsigned int | stochasticLogisticGrowth (Patch *patch, sex_t SEX) |
The number of offspring produced is drawn from a Poisson with mean equal to the logistic growth predicate. More... | |
unsigned int | conditionalLogisticGrowth (Patch *patch, sex_t SEX) |
The number of offspring produced depends on the adult density. More... | |
unsigned int | conditionalStochasticLogisticGrowth (Patch *patch, sex_t SEX) |
The number of offspring produced depends on the adult density, similar to 'conditionalLogisticGrowth' except that this time, the fecundities are drawn from Poisson distributions. More... | |
unsigned int | fixedFecundityGrowth (Patch *patch, sex_t SEX) |
The number of offspring produced is equal to the carrying capacity multiplied by the mean fecundity of the focal patch. More... | |
unsigned int | stochasticFecundityGrowth (Patch *patch, sex_t SEX) |
The number of offspring produced is a random number drawn from a Poisson distribution with mean equal to the carrying capacity multiplied by the mean fecundity of the focal patch. More... | |
Mating Functions | |
Individual * | mate_random (sex_t SEX, Patch *patch, unsigned int LocalPatch) |
Individual * | mate_random_hermaphrodite (sex_t SEX, Patch *patch, unsigned int LocalPatch) |
Individual * | mate_selfing (sex_t SEX, Patch *patch, unsigned int LocalPatch) |
Individual * | mate_full_selfing (sex_t SEX, Patch *patch, unsigned int LocalPatch) |
Individual * | mate_cloning (sex_t SEX, Patch *patch, unsigned int LocalPatch) |
Individual * | makeOffspring (Individual *ind) |
void | breed_disperse (sex_t SEX, Patch *patch, unsigned int LocalPatch, unsigned int size) |
Individual * | get_parent (sex_t SEX, sex_t DispSex, Patch *LocalPatch, unsigned int patchNbr) |
Implementations | |
virtual bool | setParameters () |
virtual void | execute () |
virtual LifeCycleEvent * | clone () |
virtual void | loadFileServices (FileServices *loader) |
virtual void | loadStatServices (StatServices *loader) |
virtual bool | resetParameterFromSource (std::string param, SimComponent *cmpt) |
virtual age_t | removeAgeClass () |
virtual age_t | addAgeClass () |
virtual age_t | requiredAgeClass () |
![]() | |
LCE_Breed_base () | |
virtual | ~LCE_Breed_base () |
virtual Individual * | getFatherPtr (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Calls the mating function according to the model chosen using the function pointer, used to get the father from the mother in a patch. More... | |
void | NonWrightFisherPopulation () |
void | WrightFisherPopulation () |
Individual * | breed (Individual *mother, Individual *father, unsigned int LocalPatch) |
Makes a new individual with the right parents. More... | |
Individual * | breed_cloning (Individual *mother, Individual *father, unsigned int LocalPatch) |
Makes a new individual by doing a deep copy of the mother (copies the mother's genes into the offspring). More... | |
Individual * | makeOffspring (Individual *ind) |
Last step of the breeding process, does inheritance and mutation of the parents' genes. More... | |
Individual * | do_breed (Individual *mother, Individual *father, unsigned int LocalPatch) |
Calls the breeding function unsing its pointer. More... | |
bool | checkMatingCondition (Patch *thePatch) |
Checks if any mating will take place in the patch passed as argument. More... | |
bool | checkNoSelfing (Patch *thePatch) |
Checks whether mating will take place in the current patch when mating is not selfing or cloning. More... | |
bool | checkPolygyny (Patch *thePatch) |
Checks whether mating will take place in the current patch when mating is polygynous. More... | |
bool | checkSelfing (Patch *thePatch) |
Checks whether mating will take place in the current patch when mating is selfing. More... | |
bool | checkCloning (Patch *thePatch) |
Checks whether mating will take place in the current patch when mating is cloning. More... | |
bool | setMatingSystem () |
bool | setFecundity () |
bool | setSexRatio () |
double | getMatingProportion () |
double | getMeanFecundity (unsigned int patch) |
int | getMatingSystem () |
bool | doInheritance () |
double | getPoissonFecundity (double mean) |
double | getFixedFecundity (double mean) |
double | getGaussianFecundity (double mean) |
double | getLogNormalFecundity (double mean) |
double | getFecundity (unsigned int patch) |
double | getFecundity (double mean) |
sex_t | getOffsprgSex () |
sex_t | getOffsprgSexRandom () |
sex_t | getOffsprgSexFixed () |
sex_t | getOffsprgSexSelfing () |
sex_t | getOffsprgSexCloning () |
Individual * | RandomMating (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns a pointer to a male drawn randomly from a patch. More... | |
Individual * | fullPolyginy (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns a pointer to the alpha male of the patch. More... | |
Individual * | fullPolyginy_manyMales (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns a pointer to one of the first _mating_males males of the patch. More... | |
Individual * | partialPolyginy (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns a pointer to a male from a patch chosen at random if _mating_proportion != 1, or the first male otherwise. More... | |
Individual * | partialPolyginy_manyMales (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns a pointer to a male from a patch chosen at random if _mating_proportion != 1, or one of the _mating_males first males otherwise. More... | |
Individual * | fullMonoginy (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns a pointer to a male with same index as mother (if available) from the focal patch. More... | |
Individual * | partialMonoginy (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns a pointer to a male with same index as mother (if available) from the focal patch. More... | |
Individual * | fullSelfing (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns the mother pointer. More... | |
Individual * | partialSelfing (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns the mother pointer or a random female if _mating_proportion != 1. More... | |
Individual * | random_hermaphrodite (Patch *thePatch, Individual *mother, unsigned int motherIndex) |
Returns a random female from the patch, will be the same mother with probability 1/N (Wright-Fisher model). More... | |
![]() | |
LifeCycleEvent (const char *name, const char *trait_link) | |
Cstor. More... | |
virtual | ~LifeCycleEvent () |
virtual void | init (Metapop *popPtr) |
Sets the pointer to the current Metapop and the trait link if applicable. More... | |
virtual bool | attach_trait (string trait) |
virtual void | set_paramset (std::string name, bool required, SimComponent *owner) |
virtual void | set_event_name (std::string &name) |
Set the name of the event (name of the ParamSet) and add the corresponding parameter to the set. More... | |
virtual void | set_event_name (const char *name) |
virtual string & | get_event_name () |
Accessor to the LCE's name. More... | |
virtual int | get_rank () |
Accessor to the LCE rank in the life cycle. More... | |
virtual void | set_pop_ptr (Metapop *popPtr) |
Accessors for the population pointer. More... | |
virtual Metapop * | get_pop_ptr () |
![]() | |
SimComponent () | |
virtual | ~SimComponent () |
virtual void | loadUpdaters (UpdaterServices *loader) |
Loads the parameters and component updater onto the updater manager. More... | |
virtual void | set_paramset (ParamSet *paramset) |
Sets the ParamSet member. More... | |
virtual void | set_paramsetFromCopy (const ParamSet &PSet) |
Reset the set of parameters from a another set. More... | |
virtual ParamSet * | get_paramset () |
ParamSet accessor. More... | |
virtual void | add_parameter (Param *param) |
Interface to add a parameter to the set. More... | |
virtual void | add_parameter (std::string Name, param_t Type, bool isRequired, bool isBounded, double low_bnd, double up_bnd) |
Interface to add a parameter to the set. More... | |
virtual void | add_parameter (std::string Name, param_t Type, bool isRequired, bool isBounded, double low_bnd, double up_bnd, ParamUpdaterBase *updater) |
Interface to add a parameter and its updater to the set. More... | |
virtual Param * | get_parameter (std::string name) |
Param getter. More... | |
virtual double | get_parameter_value (std::string name) |
Param value getter. More... | |
virtual string | get_name () |
Returnd the name of the ParamSet, i.e. More... | |
virtual bool | has_parameter (std::string name) |
Param getter. More... | |
![]() | |
LCE_Disperse_base () | |
virtual | ~LCE_Disperse_base () |
Deallocates the disp matrix. More... | |
bool | setBaseParameters (string prefix) |
void | setParamPrefix (string pref) |
void | addParameters (string prefix, ParamUpdaterBase *updater) |
void | setIndentityDispMatrix (TMatrix *mat) |
unsigned int | getMigrationPatchForward (sex_t SEX, unsigned int LocalPatch) |
unsigned int | getMigrationPatchBackward (sex_t SEX, unsigned int LocalPatch) |
void | setPropaguleTargets () |
void | swapPostDisp () |
void | reset_counters () |
void | set_isForward (bool val) |
bool | checkForwardDispersalMatrix (TMatrix *mat) |
bool | checkBackwardDispersalMatrix (TMatrix *mat) |
void | allocateDispMatrix (sex_t sex, unsigned int dim) |
bool | updateDispMatrix () |
bool | setDispMatrix () |
bool | setReducedMatricesBySex (sex_t SEX, Param &connectivity, Param &rate) |
bool | setReducedDispMatrix () |
The reduced dispersal matrix contains the indices of the patches to which each patch is connected. More... | |
bool | setIsland_MigrantPool_Matrix () |
bool | setIsland_PropagulePool_Matrix () |
bool | setSteppingStone1DMatrix () |
bool | setLatticeMatrix () |
Sets the dispersal matrices for the Lattice dispersal model. More... | |
bool | setBasicLatticeMatrix (int rows, int cols, double phi_mal, double phi_fem, double disp_mal, double disp_fem) |
bool | setLatticeTorrusMatrix (int rows, int cols, double disp_mal, double disp_fem, TMatrix *grid) |
bool | setLatticeAbsorbingMatrix () |
bool | setLatticeReflectingMatrix (int rows, int cols, TMatrix *grid) |
bool | isForward () |
bool | isByNumber () |
unsigned int | getDispersalModel () |
double | getPropaguleProb () |
unsigned int | getPropaguleTarget (unsigned int home) |
Protected Attributes | |
Individual *(LCE_Breed_Disperse::* | _make_offspring )(sex_t SEX, Patch *patch, unsigned int LocalPatch) |
unsigned int(LCE_Breed_Disperse::* | _get_numFemOffspring )(Patch *patch) |
unsigned int(LCE_Breed_Disperse::* | _get_numMalOffspring )(Patch *patch) |
unsigned int(LCE_Breed_Disperse::* | _get_patchFecundity )(Patch *patch, sex_t SEX) |
![]() | |
void(LCE_Breed_base::* | PopModelFuncPtr )(void) |
TMatrix | _mean_fecundity |
![]() | |
std::string | _event_name |
The param name to be read in the init file. More... | |
Metapop * | _popPtr |
The ptr to the current Metapop. More... | |
std::string | _LCELinkedTraitType |
The name of the linked trait. More... | |
int | _LCELinkedTraitIndex |
The index in the individual's trait table of the linked trait. More... | |
![]() | |
ParamSet * | _paramSet |
The parameters container. More... | |
![]() | |
unsigned int | _npatch |
Number of patches in the population. More... | |
vector< vector< double > > | _reducedDispMat [2] |
Matrix containing the indexes of the patches connected to each patch. More... | |
vector< vector< double > > | _reducedDispMatProba [2] |
Matrix containing the probability to migrate to/from the connected patches. More... | |
Private Attributes | |
void(LCE_Breed_Disperse::* | _breed_disperse )() |
int | _num_colonizers |
Maximum size of a patch after colonisation. More... | |
sex_t | _dispersing_sex |
Which part of the population is dispersing its gametes. More... | |
double * | _growthRates |
Patch-specific growth rates. More... | |
Performs breeding and migration in one, migration rates are backward rates.
Inherits parameters from LCE_Breed_base and LCE_Disperse_base. Population size is constant, There is no demographic stochasticity with this LCE. The number of colonizers of extinct patches can be set differently from the patch carrying capacities.
LCE_Breed_Disperse::LCE_Breed_Disperse | ( | ) |
References SimComponent::add_parameter(), LCE_Disperse_base::addParameters(), DBL, INT, setParameters(), and STR.
Referenced by clone().
|
inlinevirtual |
References _growthRates.
|
inlinevirtual |
Reimplemented from LCE_Disperse_base.
Reimplemented in LCE_Breed_Selection_Disperse.
References OFFSPRG.
void LCE_Breed_Disperse::breed_disperse | ( | sex_t | SEX, |
Patch * | patch, | ||
unsigned int | LocalPatch, | ||
unsigned int | size | ||
) |
|
inlinevirtual |
Implements LifeCycleEvent.
Reimplemented in LCE_Breed_Selection_Disperse.
References LCE_Breed_Disperse().
The number of offspring produced depends on the adult density.
A minimum number of offspring is produced when less than half of the carrying capacity of adults is present. It is logistic otherwise.
References ADLTx, fixedFecundityGrowth(), Patch::get_K(), logisticGrowth(), and Patch::size().
Referenced by setParameters().
|
inline |
The number of offspring produced depends on the adult density, similar to 'conditionalLogisticGrowth' except that this time, the fecundities are drawn from Poisson distributions.
References ADLTx, Patch::get_K(), Patch::size(), stochasticFecundityGrowth(), and stochasticLogisticGrowth().
Referenced by setParameters().
void LCE_Breed_Disperse::do_breed_disperse | ( | ) |
References _get_numFemOffspring, _get_numMalOffspring, _make_offspring, LifeCycleEvent::_popPtr, Patch::add(), ADULTS, FEM, Patch::flush(), Metapop::getPatch(), Metapop::getPatchNbr(), LCE_Breed_base::makeOffspring(), MAL, OFFSx, and Patch::size().
Referenced by do_breed_disperse_propagule(), and setParameters().
void LCE_Breed_Disperse::do_breed_disperse_propagule | ( | ) |
References do_breed_disperse(), and LCE_Disperse_base::setIsland_PropagulePool_Matrix().
Referenced by setParameters().
|
virtual |
Implements LifeCycleEvent.
Reimplemented in LCE_Breed_Selection_Disperse.
References _breed_disperse, LCE_Disperse_base::_npatch, LifeCycleEvent::_popPtr, ADULTS, fatal(), Metapop::getPatch(), Metapop::getPatchNbr(), message(), Patch::nbEmigrant, Patch::nbImigrant, Patch::nbPhilopat, OFFSPRG, LCE_Disperse_base::reset_counters(), Metapop::size(), and LCE_Disperse_base::updateDispMatrix().
The number of offspring produced is equal to the carrying capacity multiplied by the mean fecundity of the focal patch.
References Patch::get_K(), Patch::getID(), and LCE_Breed_base::getMeanFecundity().
Referenced by conditionalLogisticGrowth(), and setParameters().
Individual * LCE_Breed_Disperse::get_parent | ( | sex_t | SEX, |
sex_t | DispSex, | ||
Patch * | LocalPatch, | ||
unsigned int | patchNbr | ||
) |
References LifeCycleEvent::_popPtr, ADLTx, Patch::get(), LCE_Disperse_base::getMigrationPatchBackward(), Metapop::getPatchPtr(), Patch::nbEmigrant, Patch::nbImigrant, Patch::nbPhilopat, Patch::size(), and RAND::Uniform().
Referenced by mate_cloning(), mate_full_selfing(), mate_random(), mate_random_hermaphrodite(), and mate_selfing().
The number of offspring produced corresponds to the carrying capacity of the patch.
References Patch::get_K().
Referenced by setParameters().
|
inlinevirtual |
|
inlinevirtual |
The number of offspring produced is given by the logistic growth function.
References _growthRates, ADLTx, Patch::get_K(), Patch::getID(), and Patch::size().
Referenced by conditionalLogisticGrowth(), setParameters(), and stochasticLogisticGrowth().
Individual * LCE_Breed_Disperse::makeOffspring | ( | Individual * | ind | ) |
Individual * LCE_Breed_Disperse::mate_cloning | ( | sex_t | SEX, |
Patch * | patch, | ||
unsigned int | LocalPatch | ||
) |
References LCE_Breed_base::breed_cloning(), FEM, and get_parent().
Referenced by setParameters().
Individual * LCE_Breed_Disperse::mate_full_selfing | ( | sex_t | SEX, |
Patch * | patch, | ||
unsigned int | LocalPatch | ||
) |
References LifeCycleEvent::_popPtr, FEM, get_parent(), and IndFactory::makeNewIndividual().
Referenced by setParameters().
Individual * LCE_Breed_Disperse::mate_random | ( | sex_t | SEX, |
Patch * | patch, | ||
unsigned int | LocalPatch | ||
) |
References LifeCycleEvent::_popPtr, FEM, get_parent(), IndFactory::makeNewIndividual(), and MAL.
Referenced by setParameters().
Individual * LCE_Breed_Disperse::mate_random_hermaphrodite | ( | sex_t | SEX, |
Patch * | patch, | ||
unsigned int | LocalPatch | ||
) |
References _dispersing_sex, LifeCycleEvent::_popPtr, FEM, get_parent(), and IndFactory::makeNewIndividual().
Referenced by setParameters().
Individual * LCE_Breed_Disperse::mate_selfing | ( | sex_t | SEX, |
Patch * | patch, | ||
unsigned int | LocalPatch | ||
) |
References _dispersing_sex, LifeCycleEvent::_popPtr, ADLTx, FEM, get_parent(), LCE_Breed_base::getMatingProportion(), Metapop::getPatchNbr(), IndFactory::makeNewIndividual(), Patch::size(), and RAND::Uniform().
Referenced by setParameters().
References _dispersing_sex, _get_patchFecundity, ADLTx, FEM, and Patch::size().
Referenced by setParameters().
The number of females produced in case a max number of colonizers was specified.
References _dispersing_sex, _get_patchFecundity, _num_colonizers, FEM, and Patch::get_isExtinct().
Referenced by setParameters().
The number of males produced is always zero when the mating system is not random mating.
Referenced by setParameters().
References _dispersing_sex, _get_patchFecundity, ADLTx, FEM, MAL, and Patch::size().
Referenced by setParameters().
References _dispersing_sex, _get_patchFecundity, _num_colonizers, FEM, Patch::get_isExtinct(), and MAL.
Referenced by setParameters().
|
inlinevirtual |
Reimplemented from LCE_Disperse_base.
Reimplemented in LCE_Breed_Selection_Disperse.
References NONE.
|
inlinevirtual |
Reimplemented from LCE_Disperse_base.
Reimplemented in LCE_Breed_Selection_Disperse.
References ADULTS.
|
inlinevirtual |
Reimplemented from LCE_Disperse_base.
Reimplemented in LCE_Breed_Selection_Disperse.
|
virtual |
Reimplemented from LCE_Breed_base.
Reimplemented in LCE_Breed_Selection_Disperse.
References _breed_disperse, _dispersing_sex, _get_numFemOffspring, _get_numMalOffspring, _get_patchFecundity, _growthRates, _make_offspring, LCE_Breed_base::_mean_fecundity, _num_colonizers, SimComponent::_paramSet, LifeCycleEvent::_popPtr, conditionalLogisticGrowth(), conditionalStochasticLogisticGrowth(), do_breed_disperse(), do_breed_disperse_propagule(), error(), FEM, fixedFecundityGrowth(), TMatrix::get(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Param::getArg(), LCE_Disperse_base::getDispersalModel(), LCE_Breed_base::getMatingProportion(), LCE_Breed_base::getMatingSystem(), ParamSet::getMatrix(), TMatrix::getNbCols(), Metapop::getPatchNbr(), instantGrowth(), ParamSet::isMatrix(), Param::isSet(), ParamSet::isSet(), logisticGrowth(), MAL, mate_cloning(), mate_full_selfing(), mate_random(), mate_random_hermaphrodite(), mate_selfing(), numFemOffspring(), numFemOffspring_colonizers(), numMalOffspring_notrandom(), numMalOffspring_random(), numMalOffspring_random_colonizers(), LCE_Disperse_base::set_isForward(), LCE_Disperse_base::setBaseParameters(), LCE_Breed_base::setParameters(), stochasticFecundityGrowth(), and stochasticLogisticGrowth().
Referenced by LCE_Breed_Disperse(), and LCE_Breed_Selection_Disperse::setParameters().
The number of offspring produced is a random number drawn from a Poisson distribution with mean equal to the carrying capacity multiplied by the mean fecundity of the focal patch.
References Patch::get_K(), Patch::getID(), LCE_Breed_base::getMeanFecundity(), and RAND::Uniform().
Referenced by conditionalStochasticLogisticGrowth(), and setParameters().
The number of offspring produced is drawn from a Poisson with mean equal to the logistic growth predicate.
References logisticGrowth(), and RAND::Poisson().
Referenced by conditionalStochasticLogisticGrowth(), and setParameters().
|
private |
Referenced by execute(), and setParameters().
|
private |
Which part of the population is dispersing its gametes.
Referenced by mate_random_hermaphrodite(), mate_selfing(), numFemOffspring(), numFemOffspring_colonizers(), numMalOffspring_random(), numMalOffspring_random_colonizers(), and setParameters().
|
protected |
Referenced by LCE_Breed_Selection_Disperse::breed_selection_disperse(), do_breed_disperse(), and setParameters().
|
protected |
Referenced by LCE_Breed_Selection_Disperse::breed_selection_disperse(), do_breed_disperse(), and setParameters().
|
private |
Patch-specific growth rates.
Referenced by logisticGrowth(), setParameters(), and ~LCE_Breed_Disperse().
|
protected |
Referenced by LCE_Breed_Selection_Disperse::do_breed(), do_breed_disperse(), and setParameters().
|
private |
Maximum size of a patch after colonisation.
Referenced by numFemOffspring_colonizers(), numMalOffspring_random_colonizers(), and setParameters().