Nemo
2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
|
Base class performing (viability) selection on an arbitrary trait. More...
#include <LCEselection.h>
Public Member Functions | |
LCE_Selection_base () | |
virtual | ~LCE_Selection_base () |
bool | setSelectionMatrix () |
bool | setLocalOptima () |
bool | set_sel_model () |
bool | set_fit_model () |
bool | set_local_optima () |
bool | set_param_rate_of_change () |
void | set_std_rate_of_change () |
void | addPhenotypicSD (unsigned int deme, double *stDev) |
void | changeLocalOptima () |
void | resetCounters () |
Resets the fitness counters. More... | |
void | setMeans (unsigned int tot_ind) |
Computes the average fitness of each pedigree class. More... | |
double | getMeanFitness (age_idx age) |
Computes the mean fitness of the whole population for a given age class. More... | |
double | getMeanPatchFitness (age_idx age, unsigned int p) |
Computes the mean fitness in a given patch for a given age class. More... | |
double | getMaxFitness (age_idx age) |
Computes the maximum fitness value of the whole population for a given age class. More... | |
double | getMaxPatchFitness (age_idx age, unsigned int p) |
Computes the maximum fitness value in a given patch for a given age class. More... | |
double | setMeanFitness (age_idx age) |
Sets the _mean_fitness variable to the value of the mean population fitness. More... | |
double | getFitness (Individual *ind, unsigned int patch) |
Calls the fitness function according to the fitness model. More... | |
double | getFitnessFixedEffect (Individual *offsprg, unsigned int patch, unsigned int trait) |
Returns the fitness of an individual in the fixed selection model. More... | |
double | getFitnessDirect (Individual *offsprg, unsigned int patch, unsigned int trait) |
Returns the fitness of an individual following the direct selection model. More... | |
double | getFitnessUnivariateQuadratic (Individual *ind, unsigned int patch, unsigned int trait) |
Quadratic fitness surface, approximates the Gaussian model for weak selection and/or small deviation from the optimum. More... | |
double | getFitnessMultivariateGaussian (Individual *offsprg, unsigned int patch, unsigned int trait) |
Returns the fitness of an individual following the Gaussian selection model with one trait under selection. More... | |
double | getFitnessUnivariateGaussian (Individual *offsprg, unsigned int patch, unsigned int trait) |
Returns the fitness of an individual following the Gaussian selection model with several traits under selection. More... | |
double | getFitnessMultivariateGaussian_VE (Individual *offsprg, unsigned int patch, unsigned int trait) |
Returns the fitness of an individual following the Gaussian selection model with one trait under selection and environmental variance. More... | |
double | getFitnessUnivariateGaussian_VE (Individual *offsprg, unsigned int patch, unsigned int trait) |
Returns the fitness of an individual following the Gaussian selection model with several traits under selection and environmental variance. More... | |
double | getFitnessAbsolute (Individual *ind, unsigned int patch) |
Returns the raw fitness of the individual, without adjustment (absolute fitness). More... | |
double | getFitnessRelative (Individual *ind, unsigned int patch) |
Returns the relative fitness of the individual, adjusted by a scaling factor. More... | |
void | setScalingFactorLocal (age_idx age, unsigned int p) |
Sets the fitness scaling factor equal to the inverse of the mean local patch fitness. More... | |
void | setScalingFactorGlobal (age_idx age, unsigned int p) |
Sets the fitness scaling factor equal to the inverse of the mean population fitness. More... | |
void | setScalingFactorMaxLocal (age_idx age, unsigned int p) |
Sets the fitness scaling factor equal to the inverse of the maximum local patch fitness value. More... | |
void | setScalingFactorMaxGlobal (age_idx age, unsigned int p) |
Sets the fitness scaling factor equal to the inverse of the maximum population fitness value. More... | |
void | setScalingFactorAbsolute (age_idx age, unsigned int p) |
Resets the fitness scaling factor equal to one. More... | |
void | doViabilitySelection (sex_t SEX, age_idx AGE, Patch *patch, unsigned int p) |
Selectively removes individuals in the population depending on their fitness. More... | |
Implementations | |
virtual bool | setParameters () |
virtual void | execute () |
virtual void | loadStatServices (StatServices *loader) |
virtual void | loadFileServices (FileServices *loader) |
virtual bool | resetParameterFromSource (std::string param, SimComponent *cmpt) |
virtual LifeCycleEvent * | clone () |
virtual age_t | removeAgeClass () |
virtual age_t | addAgeClass () |
virtual age_t | requiredAgeClass () |
![]() | |
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... | |
Protected Attributes | |
double | _letheq |
double | _base_fitness |
double | _mean_fitness |
double | _max_fitness |
double | _scaling_factor |
bool | _is_local |
bool | _is_absolute |
double | _fitness [5] |
Fitness counters, one for each pedigree class. More... | |
double | _survival [5] |
double | _ind_cntr [5] |
vector< string > | _Traits |
The list of trait types under selection. More... | |
vector< unsigned int > | _TraitIndices |
The indices of the traits under selection. More... | |
vector< string > | _SelectionModels |
The selection models associated with each trait under selection. More... | |
LCE_SelectionSH * | _stater |
LCE_SelectionFH * | _writer |
Quantitative traits parameters | |
int | _selectTraitDimension |
Number of quantitative traits under selection. More... | |
vector< double > | _selection_variance |
Patch-specific selection variance. More... | |
double | _eVariance |
Evironmental variance. More... | |
Pointers to functions, set in LCE_Selection_base::setParameters | |
vector< double(LCE_Selection_base::*)(Individual *, unsigned int, unsigned int) > | _getRawFitness |
A vector containing pointers to fitness function related to each trait under selection. More... | |
double(LCE_Selection_base::* | _getFitness )(Individual *, unsigned int) |
Pointer to the function returning the individual fitness. More... | |
void(LCE_Selection_base::* | _setScalingFactor )(age_idx, unsigned int) |
Pointer to the function used to set the fitness scaling factor when fitness is relative. More... | |
void(LCE_Selection_base::* | _setNewLocalOptima )(void) |
Pointer to the function used to change the local phenotypic optima or its rate of change. More... | |
![]() | |
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... | |
Private Attributes | |
Gaussian selection variables | |
vector< TMatrix * > | _selection_matrix |
vector< gsl_matrix * > | _gsl_selection_matrix |
gsl_vector * | _diffs |
gsl_vector * | _res1 |
TMatrix * | _local_optima |
TMatrix | _rate_of_change_local_optima |
bool | _do_change_local_opt |
bool | _rate_of_change_is_std |
unsigned int | _set_std_rate_at_generation |
int | _std_rate_reference_patch |
double * | _phe |
Array to temporarily hold the phenotypic values of an individual, is never allocated. More... | |
Fixed selection (lethal-equivalents-based) parameters | |
double | _Fpedigree [5] |
Array of pedigree values used in the fixed-selection model. More... | |
double | _FitnessFixModel [5] |
Absolute fitness values of the five pedigree class for the fixed selection model (lethal equivalents model). More... | |
Friends | |
class | LCE_SelectionSH |
The StatHandler associated class is a friend. More... | |
class | LCE_SelectionFH |
class | LCE_Breed_Selection |
Base class performing (viability) selection on an arbitrary trait.
Implements several types of selection models, from fixed inbreeding depression-type model to Gaussian stabilizing selection on an adaptive landscape. This class is the base-class for the composite LCEs breed_selection and breed_selection_disperse.
LCE_Selection_base::LCE_Selection_base | ( | ) |
References SimComponent::add_parameter(), BOOL, DBL, INT, MAT, set_fit_model(), set_local_optima(), set_param_rate_of_change(), set_sel_model(), and STR.
Referenced by clone().
|
virtual |
References _diffs, _gsl_selection_matrix, _local_optima, _res1, _selection_matrix, and _stater.
|
inlinevirtual |
Implements LifeCycleEvent.
Reimplemented in LCE_Breed_Selection, and LCE_Breed_Selection_Disperse.
References NONE.
void LCE_Selection_base::addPhenotypicSD | ( | unsigned int | deme, |
double * | stDev | ||
) |
References LifeCycleEvent::_LCELinkedTraitIndex, _phe, LifeCycleEvent::_popPtr, _selectTraitDimension, FEM, Patch::get(), Metapop::getPatch(), Individual::getTraitValue(), MAL, my_mean(), my_variance_with_fixed_mean(), OFFSx, and Patch::size().
Referenced by set_std_rate_of_change().
void LCE_Selection_base::changeLocalOptima | ( | ) |
References _local_optima, _rate_of_change_local_optima, _selectTraitDimension, TMatrix::get(), TMatrix::nrows(), and TMatrix::plus().
Referenced by set_param_rate_of_change(), and set_std_rate_of_change().
|
inlinevirtual |
Implements LifeCycleEvent.
Reimplemented in LCE_Breed_Selection, and LCE_Breed_Selection_Disperse.
References LCE_Selection_base().
void LCE_Selection_base::doViabilitySelection | ( | sex_t | SEX, |
age_idx | AGE, | ||
Patch * | patch, | ||
unsigned int | p | ||
) |
Selectively removes individuals in the population depending on their fitness.
Calls the fitness function for each individual. Updates the fitness counters. The fitness scaling factor is set outside this function, in the execute() procedure.
SEX | the sex class |
AGE | the age-class index |
patch | the focal patch |
p | the focal patch index |
References _fitness, _ind_cntr, LifeCycleEvent::_popPtr, _survival, Patch::get(), getFitness(), Individual::getPedigreeClass(), IndFactory::recycle(), Patch::remove(), Patch::size(), and RAND::Uniform().
Referenced by execute().
|
virtual |
Implements LifeCycleEvent.
Reimplemented in LCE_Breed_Selection, and LCE_Breed_Selection_Disperse.
References _do_change_local_opt, _mean_fitness, LifeCycleEvent::_popPtr, _rate_of_change_is_std, _setNewLocalOptima, _setScalingFactor, doViabilitySelection(), FEM, Metapop::getCurrentGeneration(), Metapop::getPatch(), Metapop::getPatchNbr(), MAL, message(), OFFSPRG, OFFSx, resetCounters(), set_local_optima(), set_std_rate_of_change(), setMeans(), and Metapop::size().
|
inline |
Calls the fitness function according to the fitness model.
The fitness model can be "absolute", "relative_local" or "relative_global".
ind | the focal indvidual, we want to know its fitness |
patch | the index of the patch of the focal individual |
References _getFitness.
Referenced by LCE_Breed_Selection::do_breed_selection_FecFitness(), doViabilitySelection(), getMaxPatchFitness(), getMeanFitness(), getMeanPatchFitness(), LCE_Breed_Selection::makeOffspringWithSelection(), LCE_SelectionSH::setDataTable(), and LCE_Breed_Selection::setReproScaledFitness_sum().
double LCE_Selection_base::getFitnessAbsolute | ( | Individual * | ind, |
unsigned int | patch | ||
) |
Returns the raw fitness of the individual, without adjustment (absolute fitness).
Calls the fitness function according to the right selection model.
ind | the focal indvidual, we want to know its fitness |
patch | the index of the patch of the focal individual |
References _getRawFitness, and _TraitIndices.
Referenced by getFitnessRelative(), and set_fit_model().
|
inline |
Returns the fitness of an individual following the direct selection model.
References Individual::getTraitValue().
Referenced by set_sel_model().
|
inline |
Returns the fitness of an individual in the fixed selection model.
References _FitnessFixModel, and Individual::getPedigreeClass().
Referenced by set_sel_model().
double LCE_Selection_base::getFitnessMultivariateGaussian | ( | Individual * | offsprg, |
unsigned int | patch, | ||
unsigned int | trait | ||
) |
Returns the fitness of an individual following the Gaussian selection model with one trait under selection.
References _diffs, _gsl_selection_matrix, _local_optima, _phe, _res1, _selectTraitDimension, TMatrix::get(), and Individual::getTraitValue().
Referenced by set_sel_model().
double LCE_Selection_base::getFitnessMultivariateGaussian_VE | ( | Individual * | offsprg, |
unsigned int | patch, | ||
unsigned int | trait | ||
) |
Returns the fitness of an individual following the Gaussian selection model with one trait under selection and environmental variance.
References _diffs, _eVariance, _gsl_selection_matrix, _local_optima, _phe, _res1, _selectTraitDimension, RAND::Gaussian(), TMatrix::get(), and Individual::getTraitValue().
Referenced by set_sel_model().
|
inline |
Returns the relative fitness of the individual, adjusted by a scaling factor.
The scaling factor is set according to the relative fitness model (local or global) outside of this function. If the scaling factor is one, this is the absolute fitness of the individual. Calls the fitness function according to the right selection model.
ind | the focal indvidual, we want to know its fitness |
patch | the index of the patch of the focal individual |
References _scaling_factor, and getFitnessAbsolute().
Referenced by set_fit_model().
double LCE_Selection_base::getFitnessUnivariateGaussian | ( | Individual * | offsprg, |
unsigned int | patch, | ||
unsigned int | trait | ||
) |
Returns the fitness of an individual following the Gaussian selection model with several traits under selection.
References _local_optima, _phe, _selection_variance, TMatrix::get(), and Individual::getTraitValue().
Referenced by set_sel_model().
double LCE_Selection_base::getFitnessUnivariateGaussian_VE | ( | Individual * | offsprg, |
unsigned int | patch, | ||
unsigned int | trait | ||
) |
Returns the fitness of an individual following the Gaussian selection model with several traits under selection and environmental variance.
References _eVariance, _local_optima, _phe, _selection_variance, RAND::Gaussian(), TMatrix::get(), and Individual::getTraitValue().
Referenced by set_sel_model().
double LCE_Selection_base::getFitnessUnivariateQuadratic | ( | Individual * | ind, |
unsigned int | patch, | ||
unsigned int | trait | ||
) |
Quadratic fitness surface, approximates the Gaussian model for weak selection and/or small deviation from the optimum.
References _local_optima, _phe, _selection_variance, TMatrix::get(), and Individual::getTraitValue().
Referenced by set_sel_model().
double LCE_Selection_base::getMaxFitness | ( | age_idx | age | ) |
Computes the maximum fitness value of the whole population for a given age class.
age | the age-class index |
References LifeCycleEvent::_popPtr, getMaxPatchFitness(), and Metapop::getPatchNbr().
Referenced by setScalingFactorMaxGlobal().
Computes the maximum fitness value in a given patch for a given age class.
age | the age-class index |
p | the patch index |
References LifeCycleEvent::_popPtr, FEM, Patch::get(), getFitness(), Metapop::getPatch(), MAL, and Patch::size().
Referenced by getMaxFitness(), and setScalingFactorMaxLocal().
double LCE_Selection_base::getMeanFitness | ( | age_idx | age | ) |
Computes the mean fitness of the whole population for a given age class.
age | the age-class index |
References LifeCycleEvent::_popPtr, FEM, Patch::get(), getFitness(), Metapop::getPatch(), Metapop::getPatchNbr(), MAL, Metapop::size(), and Patch::size().
Referenced by LCE_Breed_Selection_Disperse::execute(), setMeanFitness(), and setScalingFactorGlobal().
Computes the mean fitness in a given patch for a given age class.
age | the age-class index |
p | the patch index |
References LifeCycleEvent::_popPtr, FEM, Patch::get(), getFitness(), Metapop::getPatch(), MAL, and Patch::size().
Referenced by LCE_Breed_Selection_Disperse::breed_selection_disperse(), and setScalingFactorLocal().
|
virtual |
Implements SimComponent.
Reimplemented in LCE_Breed_Selection, and LCE_Breed_Selection_Disperse.
References SimComponent::_paramSet, _writer, FileServices::attach(), fatal(), SimComponent::get_parameter(), Param::getMatrix(), Param::getValue(), Param::isMatrix(), Param::isSet(), ParamSet::isSet(), LCE_SelectionFH, EventFileHandler< LCE >::set(), and FileHandler::set_multi().
|
virtual |
Implements SimComponent.
Reimplemented in LCE_Breed_Selection, and LCE_Breed_Selection_Disperse.
References _stater, StatServices::attach(), and LCE_SelectionSH.
Referenced by LCE_Breed_Selection::loadStatServices(), and LCE_Breed_Selection_Disperse::loadStatServices().
|
inlinevirtual |
Implements LifeCycleEvent.
Reimplemented in LCE_Breed_Selection, and LCE_Breed_Selection_Disperse.
References NONE.
|
inlinevirtual |
Implements LifeCycleEvent.
Reimplemented in LCE_Breed_Selection, and LCE_Breed_Selection_Disperse.
References OFFSPRG.
void LCE_Selection_base::resetCounters | ( | ) |
Resets the fitness counters.
References _fitness, _ind_cntr, and _survival.
Referenced by LCE_Breed_Selection::execute(), LCE_Breed_Selection_Disperse::execute(), execute(), and setParameters().
|
inlinevirtual |
Implements SimComponent.
Reimplemented in LCE_Breed_Selection, and LCE_Breed_Selection_Disperse.
bool LCE_Selection_base::set_fit_model | ( | ) |
References _getFitness, _is_absolute, _is_local, SimComponent::_paramSet, _setScalingFactor, error(), ParamSet::getArg(), getFitnessAbsolute(), getFitnessRelative(), ParamSet::isSet(), setScalingFactorAbsolute(), setScalingFactorGlobal(), setScalingFactorLocal(), setScalingFactorMaxGlobal(), and setScalingFactorMaxLocal().
Referenced by LCE_Selection_base(), and setParameters().
bool LCE_Selection_base::set_local_optima | ( | ) |
References _local_optima, SimComponent::_paramSet, LifeCycleEvent::_popPtr, _selectTraitDimension, error(), SimComponent::get_parameter(), ParamSet::getArg(), ParamSet::getMatrix(), Metapop::getPatchNbr(), ParamSet::isSet(), TMatrix::reset(), and setSpatialMatrix().
Referenced by execute(), LCE_Selection_base(), and setParameters().
bool LCE_Selection_base::set_param_rate_of_change | ( | ) |
References _do_change_local_opt, LifeCycleEvent::_popPtr, _rate_of_change_is_std, _rate_of_change_local_optima, _selectTraitDimension, _set_std_rate_at_generation, _setNewLocalOptima, _std_rate_reference_patch, TMatrix::assign(), changeLocalOptima(), error(), TMatrix::get(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Param::getMatrix(), Metapop::getPatchNbr(), TMatrix::ncols(), TMatrix::nrows(), TMatrix::reset(), TMatrix::set(), and set_std_rate_of_change().
Referenced by LCE_Selection_base(), and setParameters().
bool LCE_Selection_base::set_sel_model | ( | ) |
References _base_fitness, _eVariance, _FitnessFixModel, _Fpedigree, _getRawFitness, _letheq, SimComponent::_paramSet, LifeCycleEvent::_popPtr, _SelectionModels, _selectTraitDimension, _TraitIndices, _Traits, error(), TMatrix::get(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), getFitnessDirect(), getFitnessFixedEffect(), getFitnessMultivariateGaussian(), getFitnessMultivariateGaussian_VE(), getFitnessUnivariateGaussian(), getFitnessUnivariateGaussian_VE(), getFitnessUnivariateQuadratic(), Param::getMatrix(), Param::getMultiArgs(), TMatrix::getNbCols(), IndFactory::getTraitPrototype(), ParamSet::isSet(), setSelectionMatrix(), and warning().
Referenced by LCE_Selection_base(), and setParameters().
void LCE_Selection_base::set_std_rate_of_change | ( | ) |
References SimRunner::_FileServices, LifeCycleEvent::_popPtr, _rate_of_change_local_optima, _selectTraitDimension, _set_std_rate_at_generation, _setNewLocalOptima, _std_rate_reference_patch, addPhenotypicSD(), TMatrix::assign(), changeLocalOptima(), TMatrix::get(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Metapop::getCurrentGeneration(), Param::getMatrix(), Metapop::getPatch(), Metapop::getPatchNbr(), FileServices::log(), SIMenv::MainSim, TMatrix::multi(), TMatrix::ncols(), TMatrix::nrows(), OFFSx, TMatrix::reset(), TMatrix::set(), Patch::size(), and TMatrix::to_string().
Referenced by execute(), and set_param_rate_of_change().
bool LCE_Selection_base::setLocalOptima | ( | ) |
|
inline |
Sets the _mean_fitness variable to the value of the mean population fitness.
age | the age-class index |
References _mean_fitness, and getMeanFitness().
void LCE_Selection_base::setMeans | ( | unsigned int | tot_ind | ) |
Computes the average fitness of each pedigree class.
Called after selection has been done in the whole population.
tot_ind | count of the total number of individuals produced |
References _fitness, _ind_cntr, _mean_fitness, and _survival.
Referenced by LCE_Breed_Selection::execute(), LCE_Breed_Selection_Disperse::execute(), and execute().
|
virtual |
Implements SimComponent.
Reimplemented in LCE_Breed_Selection, and LCE_Breed_Selection_Disperse.
References LifeCycleEvent::_event_name, _getRawFitness, _max_fitness, _mean_fitness, LifeCycleEvent::_popPtr, _scaling_factor, _TraitIndices, _Traits, error(), SimComponent::get_parameter(), Param::getMultiArgs(), IndFactory::getTraitIndex(), resetCounters(), set_fit_model(), set_local_optima(), set_param_rate_of_change(), and set_sel_model().
Referenced by LCE_Breed_Selection::setParameters(), and LCE_Breed_Selection_Disperse::setParameters().
Resets the fitness scaling factor equal to one.
age | the age-class index |
p | the focal patch index |
References _scaling_factor.
Referenced by set_fit_model().
Sets the fitness scaling factor equal to the inverse of the mean population fitness.
Function exits on p != 0; the mean population fitness is computed only once in the execute() procedure, at the beginning of the patch loop.
age | the age-class index |
p | the focal patch index |
References _scaling_factor, and getMeanFitness().
Referenced by set_fit_model(), and LCE_SelectionSH::setDataTable().
Sets the fitness scaling factor equal to the inverse of the mean local patch fitness.
age | the age-class index |
p | the focal patch index |
References _scaling_factor, and getMeanPatchFitness().
Referenced by set_fit_model(), and LCE_SelectionSH::setDataTable().
Sets the fitness scaling factor equal to the inverse of the maximum population fitness value.
Function exits on p != 0; the mean population fitness is computed only once in the execute() procedure, at the beginning of the patch loop.
age | the age-class index |
p | the focal patch index |
References _scaling_factor, and getMaxFitness().
Referenced by set_fit_model().
Sets the fitness scaling factor equal to the inverse of the maximum local patch fitness value.
age | the age-class index |
p | the focal patch index |
References _scaling_factor, and getMaxPatchFitness().
Referenced by set_fit_model().
bool LCE_Selection_base::setSelectionMatrix | ( | ) |
References _diffs, _gsl_selection_matrix, SimComponent::_paramSet, LifeCycleEvent::_popPtr, _res1, _selection_matrix, _selection_variance, _selectTraitDimension, TMatrix::assign(), error(), TMatrix::get(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), ParamSet::getMatrix(), TMatrix::getNbCols(), TMatrix::getNbRows(), Metapop::getPatchNbr(), Param::isMatrix(), Param::isSet(), ParamSet::isSet(), TMatrix::reset(), TMatrix::set(), and setSpatialMatrix().
Referenced by set_sel_model().
|
friend |
|
friend |
Referenced by loadFileServices().
|
friend |
The StatHandler associated class is a friend.
Referenced by loadStatServices().
|
protected |
|
private |
|
private |
Referenced by execute(), and set_param_rate_of_change().
|
protected |
Evironmental variance.
Referenced by getFitnessMultivariateGaussian_VE(), getFitnessUnivariateGaussian_VE(), and set_sel_model().
|
protected |
Fitness counters, one for each pedigree class.
Referenced by LCE_Breed_Selection::do_breed_selection_FecFitness(), doViabilitySelection(), LCE_SelectionSH::getFitness(), LCE_Breed_Selection::makeOffspringWithSelection(), resetCounters(), and setMeans().
|
private |
Absolute fitness values of the five pedigree class for the fixed selection model (lethal equivalents model).
Fitness is computed as: _FitnessFixModel[i] = _base_fitness * exp( -_letheq * _Fpedigree[i] );
Referenced by getFitnessFixedEffect(), and set_sel_model().
|
private |
Array of pedigree values used in the fixed-selection model.
Referenced by set_sel_model().
|
protected |
Pointer to the function returning the individual fitness.
May point to LCE_Selection_base::getFitnessAbsolute or LCE_Selection_base::getFitnessRelative.
Referenced by getFitness(), and set_fit_model().
|
protected |
A vector containing pointers to fitness function related to each trait under selection.
Referenced by getFitnessAbsolute(), LCE_SelectionFH::print(), set_sel_model(), and setParameters().
|
private |
|
protected |
|
protected |
Referenced by set_fit_model(), and LCE_SelectionSH::setDataTable().
|
protected |
Referenced by set_fit_model(), and LCE_SelectionSH::setDataTable().
|
protected |
Referenced by set_sel_model().
|
private |
|
protected |
Referenced by setParameters().
|
protected |
|
private |
Array to temporarily hold the phenotypic values of an individual, is never allocated.
Referenced by addPhenotypicSD(), getFitnessMultivariateGaussian(), getFitnessMultivariateGaussian_VE(), getFitnessUnivariateGaussian(), getFitnessUnivariateGaussian_VE(), and getFitnessUnivariateQuadratic().
|
private |
Referenced by execute(), and set_param_rate_of_change().
|
private |
Referenced by changeLocalOptima(), set_param_rate_of_change(), and set_std_rate_of_change().
|
private |
|
protected |
Referenced by LCE_Breed_Selection_Disperse::breed_selection_disperse(), LCE_Breed_Selection::execute(), LCE_Breed_Selection_Disperse::execute(), getFitnessRelative(), setParameters(), LCE_Breed_Selection::setReproScaledFitness_sum(), setScalingFactorAbsolute(), setScalingFactorGlobal(), setScalingFactorLocal(), setScalingFactorMaxGlobal(), and setScalingFactorMaxLocal().
|
private |
Referenced by setSelectionMatrix(), and ~LCE_Selection_base().
|
protected |
Patch-specific selection variance.
Referenced by getFitnessUnivariateGaussian(), getFitnessUnivariateGaussian_VE(), getFitnessUnivariateQuadratic(), and setSelectionMatrix().
|
protected |
The selection models associated with each trait under selection.
Referenced by set_sel_model().
|
protected |
Number of quantitative traits under selection.
Referenced by addPhenotypicSD(), changeLocalOptima(), getFitnessMultivariateGaussian(), getFitnessMultivariateGaussian_VE(), set_local_optima(), set_param_rate_of_change(), set_sel_model(), set_std_rate_of_change(), and setSelectionMatrix().
|
private |
Referenced by set_param_rate_of_change(), and set_std_rate_of_change().
|
protected |
Pointer to the function used to change the local phenotypic optima or its rate of change.
May point to LCE_Selection_base::changeLocalOptima or LCE_Selection_base::set_std_rate_of_change.
Referenced by execute(), set_param_rate_of_change(), and set_std_rate_of_change().
Pointer to the function used to set the fitness scaling factor when fitness is relative.
May point to LCE_Selection_base::setScalingFactorGlobal, LCE_Selection_base::setScalingFactorLocal, or LCE_Selection_base::setScalingFactorAbsolute (returns 1).
Referenced by LCE_Breed_Selection::do_breed_selection_FecFitness(), execute(), and set_fit_model().
|
protected |
Referenced by loadStatServices(), and ~LCE_Selection_base().
|
private |
Referenced by set_param_rate_of_change(), and set_std_rate_of_change().
|
protected |
|
protected |
The indices of the traits under selection.
Referenced by LCE_SelectionFH::FHwrite(), getFitnessAbsolute(), LCE_Breed_Selection::makeOffspringWithSelection(), LCE_SelectionFH::print(), set_sel_model(), LCE_Breed_Selection::setNonSelectedTraitTable(), and setParameters().
|
protected |
The list of trait types under selection.
Referenced by set_sel_model(), and setParameters().
|
protected |
Referenced by loadFileServices().