Nemo
2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
|
Top class of the metapopulation structure, contains the patches. More...
#include <metapop.h>
Public Member Functions | |
Metapop () | |
virtual | ~Metapop () |
bool | init () |
Inits the population parameters from the ParamSet and builds the pop (adds patches), the prototypes and the life cycle. More... | |
virtual bool | setParameters () |
bool | setPopulationParameters () |
Population's size parameters initializing procedure. More... | |
bool | setSourceParameters () |
Setter for source population parameters. More... | |
bool | updatePopulationParameters () |
Called during simulation to change the population's parameters (temporal argument). More... | |
void | reset () |
Called to empty the patches, individuals are move to the garbage collector. More... | |
void | clear () |
Called at the end of each simulation, empties the pop and the garbage collector; the Individuals are destroyed. More... | |
void | setMPImanager (MPImanager *mgr) |
void | store_trait (int trait_idx, BinaryStorageBuffer *saver) |
Iterates through the individuals containers to store the trait data to a binary file. More... | |
void | read_trait (int trait_idx, BinaryStorageBuffer *loader) |
Iterates through the individuals containers to retrieve the trait data from a binary file. More... | |
void | show_up () |
Population builders | |
void | resizePatchArray () |
Resets the patch container to the right number of patches as set by _patchNbr. More... | |
void | buildPatchArray () |
Builds the new population from parameter values. More... | |
void | updatePatchArray () |
Called during simulation to modify the meta-population size. More... | |
void | updatePatchState () |
Update the patch capacities and patch ID (reset to array position). More... | |
void | setPatchCapacities () |
Sets the deme capacity matrix from parameter values. More... | |
void | setPatchCapacities (string param) |
Builds the new population from a single matrix of deme sizes. More... | |
void | setPatchCapacities (sex_t SEX, string param) |
Builds the new population from a matrix of deme sizes but for one sex only. More... | |
void | setPatchCapacities (string paramfem, string parammal) |
Builds the new population from matrices of deme sizes. More... | |
void | loadSourcePopulation () |
Loads a population from a soure population. More... | |
void | loadPopFromBinarySource (string &filename) |
Loads the population from a binary data file when setting the first generation of a replicate. More... | |
void | loadPopFromTraitFile (string &filename) |
Loads a population from a trait's data file (text file). More... | |
void | setPopulation (unsigned int currentReplicate, unsigned int replicates) |
Sets the population for the first generation of each replicates. More... | |
void | setPopulationFromSourceInPreserveMode () |
void | setPopulationFromSource () |
void | fillPopulationFromSource (age_idx AGE, sex_t SEX, deque< Individual * > &src_pool) |
Fills the population of the first generation of each replicates with individuals from a population source. More... | |
void | fillPatchFromSource (sex_t SEX, Patch *src, Patch *patch, age_t AGE) |
Fills a patch from a source patch loaded from a binary file, used when setting the population in preserve mode. More... | |
Implementations | |
virtual void | loadFileServices (FileServices *loader) |
virtual void | loadStatServices (StatServices *loader) |
virtual bool | resetParameterFromSource (std::string param, SimComponent *cmpt) |
virtual void | store_data (BinaryStorageBuffer *saver) |
virtual bool | retrieve_data (BinaryStorageBuffer *reader) |
Getters | |
Patch * | getPatch (unsigned int i) |
Patch accessor, return the ith+1 patch in the metapop. More... | |
Patch * | getPatchPtr (unsigned int patch) |
A secure version of the getPatch() method. More... | |
deque< Patch * > * | getPatchArray () |
unsigned int | getPatchArraySize () |
void | getAllIndividuals (age_idx AGE, deque< Individual * > &fem_pool, deque< Individual * > &mal_pool) |
void | setGenerations (unsigned int gen) |
unsigned int | getGenerations () |
void | setReplicates (unsigned int repl) |
unsigned int | getReplicates () |
unsigned int | getPatchNbr () |
unsigned int | getPatchKFem () |
unsigned int | getPatchKMal () |
unsigned int | getPatchCapacity () |
unsigned int | getPatchCapacity (sex_t SEX, unsigned int patch) |
TMatrix * | getPatchCapacities () |
bool | isSourceLoad () |
string | getSourceName () |
string | getSourceFileType () |
unsigned int | getSourceReplDigits () |
void | setPatchNbr (unsigned int val) |
void | setPatchSizes (TMatrix &mat) |
Population state interface | |
unsigned int | getCurrentReplicate () |
unsigned int | getCurrentGeneration () |
void | setCurrentReplicate (unsigned int repl) |
void | setCurrentGeneration (unsigned int gen) |
age_t | getCurrentAge () |
void | setCurrentAge (age_t age) |
Sets the age flag. More... | |
void | setCurrentAge (LifeCycleEvent *LCE) |
Set the age flag from a LifeCycleEvent object. More... | |
bool | isAlive () |
Checks if the population still contains at least one individual in any sex or age class. More... | |
unsigned int | size () |
Get the total number of individuals present in the population, all sex and age classes together. More... | |
unsigned int | size (sex_t SEX, age_t AGE) |
Interface to get the size of a praticular age and sex class(es). More... | |
unsigned int | size (sex_t SEX, age_idx IDX) |
Interface to get the size of a praticular age class and sex class. More... | |
unsigned int | size (age_idx IDX) |
Returns the size of the container for the appropriate age class for both sexes. More... | |
unsigned int | size (age_idx IDX, unsigned int deme) |
unsigned int | size (sex_t SEX, age_idx IDX, unsigned int deme) |
unsigned int | size (sex_t SEX, age_t AGE, unsigned int deme) |
Interface to get the size of a praticular age and sex class within a patch. More... | |
unsigned int | size (age_t AGE) |
Simplified interface to get the size of both sexes of the appropriate age class(es) in the whole population. More... | |
unsigned int | size (age_t AGE, unsigned int deme) |
Simplified interface to get the size of both sexes of the appropriate age class(es) in one patch. More... | |
Individual * | get (sex_t SEX, age_idx AGE, unsigned int at, unsigned int deme) |
Returns a pointer to the appropriate individual. More... | |
void | move (sex_t SEX, age_idx from_age, unsigned int from_deme, age_idx to_age, unsigned int to_deme, unsigned int at) |
Moves an individual from a deme to an other one, both demes sizes are modified. More... | |
void | flush () |
Removes all individual pointers and flush them into the recycling pool. More... | |
void | flush (sex_t SEX, age_idx AGE) |
Removes all individual pointers of the appropriate sex and age class and flush them into the recycling pool. More... | |
void | flush (age_idx AGE) |
Removes all individual pointers of both sexes and specified age class and flush them into the recycling pool. More... | |
void | flush (age_t AGE) |
Removes all individual pointers of both sexes and specified age class(es) and flush them into the recycling pool. More... | |
Patch * | removePatch (unsigned int i) |
Removes a patch from the patch array and returns it pointer. More... | |
void | deletePatch (unsigned int i) |
Removes a patch from the patch array and deletes it and its content. More... | |
void | addPatch (Patch *patch) |
Adds a patch to the population. More... | |
void | addPatch (unsigned int num) |
Adds num patches to the population. More... | |
![]() | |
virtual void | store_data (BinaryStorageBuffer *saver)=0 |
Interface to store the component data (e.g. gene values) into a binary buffer. More... | |
virtual bool | retrieve_data (BinaryStorageBuffer *reader)=0 |
Interface to retrieve the same data from the binary buffer. More... | |
virtual | ~StorableComponent () |
![]() | |
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_paramset (std::string name, bool required, SimComponent *owner) |
Sets a new ParamSet and name it. 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... | |
![]() | |
IndFactory () | |
virtual | ~IndFactory () |
void | recycle (Individual *ind) |
Put an individual in the recycling pool. More... | |
void | purgeRecyclingPOOL () |
Empty the recycling pool. More... | |
void | makePrototype (map< trait_t, TraitPrototype * > TTlist) |
Creates the individuals prototype from the selected trait prototypes. More... | |
void | clearPrototype () |
Reset the trait prototypes, mostly done to unregister the genetic maps. More... | |
Individual * | getPrototypeClone () |
Return an uninitialized copy of the individual prototype. More... | |
Individual * | getNewIndividual () |
Creates a blank individual which has to be "decorated" later. More... | |
Individual * | makeNewIndividual (Individual *mother, Individual *father, sex_t sex, unsigned short homepatch) |
Creates an individual with pointers to parents, sex and home ID set but no genetic data. More... | |
Individual * | makeOffsprg (Individual *mother, Individual *father, sex_t sex, unsigned short homepatch) |
Completely creates an individual with inheritance and mutations on all traits. More... | |
Individual * | getIndividualProtoype () |
Individual prototype accessor. More... | |
TraitPrototype * | getTraitPrototype (trait_t type) |
Accessor to a TraitPrototype. More... | |
std::map< trait_t, TraitPrototype * > & | getTraitPrototypes () |
Accessor to the list of TraitPrototype's. More... | |
int | getTraitIndex (trait_t type) |
Gives the index of trait with type. More... | |
Private Attributes | |
MPImanager * | _mpimgr |
MPStatHandler | _statHandler |
The stat handler for the population stats. More... | |
MPFileHandler * | _writer |
The file handler used to save pedigree info. More... | |
deque< Patch * > | _vPatch |
The Patch container. More... | |
age_t | _requiredAge |
The age class flag that is required to fill the population at the beginning of a replicate. More... | |
unsigned int | _patchNbr |
Number of patches in the population. More... | |
unsigned int | _patchK |
Patch carrying capacity. More... | |
unsigned int | _patchKfem |
Sex specific carrying capacities. More... | |
unsigned int | _patchKmal |
TMatrix | _patchSizes |
Matrix of the deme sizes, row 0 for the males, row 1 for the females. More... | |
unsigned int | _generations |
Number of generations to iterate. More... | |
unsigned int | _replicates |
Number of replicates to iterate. More... | |
unsigned int | _currentGeneration |
The current generation in the generation loop, starts at 1. More... | |
unsigned int | _currentReplicate |
The current replicate in the replicate loop, starts at 1. More... | |
age_t | _currentAge |
The current age class, might be changed by the LCEs. More... | |
binary source loader: | |
BinaryDataLoader | _loader |
A BinaryDataLoader to load a population from a binary data file. More... | |
Metapop * | _source |
A source population as loaded from a binary data file, used to build a population. More... | |
bool | _source_preserve |
Flag to specify the loading mode, true means the source pop is the actual population. More... | |
bool | _source_load |
Flage to specify that the population should be built from the binary loaded source population. More... | |
unsigned int | _source_replicates |
The number of source files, each file being a different replicate of the source population. More... | |
unsigned int | _source_replicate_digits |
Number of digits in the replicate counter filename extension. More... | |
unsigned int | _source_start_at_replicate |
The replicate number to start loading from. More... | |
unsigned int | _source_generation |
The generation to load from the binary file source file. More... | |
std::string | _source_name |
The base filename of source population files. More... | |
std::string | _source_filetype |
The trait type to load from. More... | |
std::string | _source_required_age |
The age class to fill with the source population. More... | |
unsigned int | _source_load_periodicity |
The number of replicates to source from a single source replicate. More... | |
vector< string > | _source_param_override |
List of parameters whose values in the source should override local values in the loading pop. More... | |
Friends | |
Metapop * | BinaryDataLoader::extractPop (std::string &, unsigned int, SimBuilder *, Metapop *) |
Additional Inherited Members | |
![]() | |
ParamSet * | _paramSet |
The parameters container. More... | |
![]() | |
std::map< trait_t, TraitPrototype * > | _protoTraits |
Map of the trait prototypes. More... | |
std::map< trait_t, int > | _TraitsIndex |
Table containing the index of each trait. More... | |
Individual | _protoIndividual |
The individuals prototype used to create any new individual in a simulation. More... | |
std::deque< Individual * > | RecyclingPOOL |
Garbage collector for unused Individual's. More... | |
Top class of the metapopulation structure, contains the patches.
The basic design for the metapopulation structure is a top-down chain of responsibility where the Metapop class takes care of the patches it contains which are themselves concerned by the management of their individual containers. The Individual class is only concerned by the management of its traits. Thereby, a metapopulation can be viewed as an interleaving of containers where one container class takes care of its directly contained class only, without knowledge of the upward container state.
The Metapop class thus implements methods used to manage and get information from the patches, to manage the parameters necessary to build a population and to get the population state information. It also implements the methods used to load a population from different source files.
Population states: given by the number and the position of the individuals (both spatially in demes and temporally in age class containers). The Metapop::_currentAge flag is set according to the age state of the metapopulation. The life cycle events modify that state by moving individuals among individuals containers within the metatpopulation. The Metapop::_currentAge flag can contain the following age class bits as defined in types.h. The OFFSPRNG (=1) age class bit is set whenever the offspring containers are not empty. The ADULTS (=4) age class bit is set whenever the adult containers are not empty. The POSTDISP (=2) age class bit informs about the content of the post-dispersal containers. The ALL (=7) age class is the addition of the previous tags and NONE (=0) is the negation of them. The individual containers are stored in the patches and handled through the Patch class interface. Each age class is represented by two containers, one for the males (index 0) and the other for the females (index 1). These containers are store in a table and are accessed through their age class index as defined by the age_idx enum (see types.h). These indexes are as follows: The OFFSPRNG age class has index OFFSx = 0, the POSTDISP age class has index PDISPx = 1 and the ADULTS age class has index ADLTx = 2.
Metapop::Metapop | ( | ) |
References SimComponent::add_parameter(), BOOL, INT, SimComponent::set_paramset(), setSourceParameters(), STR, and updatePopulationParameters().
|
virtual |
|
inline |
Adds a patch to the population.
The patch is added at the end of the array and it is empty.
References _vPatch.
Referenced by LCE_Resize::buildNewPatchArrayWithBackup(), FileServices::getSampledPop(), and LCE_Resize::removeDesignatedPatch().
|
inline |
void Metapop::buildPatchArray | ( | ) |
Builds the new population from parameter values.
Supernumerary patches are deleted. All patches are empty.
References _patchNbr, _patchSizes, _vPatch, FEM, TMatrix::get(), MAL, and resizePatchArray().
Referenced by BinaryDataLoader::extractPop(), init(), and setPopulation().
void Metapop::clear | ( | ) |
Called at the end of each simulation, empties the pop and the garbage collector; the Individuals are destroyed.
References _patchNbr, _source, _source_filetype, _vPatch, and message().
Referenced by SimRunner::Replicate_LOOP(), and ~Metapop().
|
inline |
Removes a patch from the patch array and deletes it and its content.
The IDs of the remaining patches are updated.
i | the index of the patch to remove. |
References _vPatch.
Referenced by LCE_Resize::removeDesignatedPatch().
Fills a patch from a source patch loaded from a binary file, used when setting the population in preserve mode.
SEX | sex of the individuals to fetch from the source pop |
src | the source patch that will be copied. |
patch | the local patch to be filled with individuals copied from the source patch. |
AGE | age class to copy individuals from the source. |
References _requiredAge, Patch::add(), ADLTx, Patch::get(), IndFactory::getNewIndividual(), OFFSPRG, OFFSx, and Patch::size().
Referenced by setPopulationFromSourceInPreserveMode().
void Metapop::fillPopulationFromSource | ( | age_idx | AGE, |
sex_t | SEX, | ||
deque< Individual * > & | src_pool | ||
) |
Fills the population of the first generation of each replicates with individuals from a population source.
AGE | age of the individuals to fetch from the source pop |
SEX | sex of the individuals to fetch from the source pop |
src_pool | the container where the source individuals will be placed, they are not removed from the source. |
References _patchNbr, _vPatch, IndFactory::getNewIndividual(), OFFSx, RAND::Uniform(), and warning().
Referenced by setPopulationFromSource().
|
inline |
Removes all individual pointers and flush them into the recycling pool.
Container sizes are reset to null values.
References _patchNbr, _vPatch, and flush().
Referenced by LCE_Breed::execute(), LCE_Breed_Selection::execute(), LCE_Cross::execute(), LCE_Breed_Quanti::execute(), LCE_Breed_Wolbachia::execute(), flush(), and LCE_Cross::generatePedigree().
|
inline |
Removes all individual pointers of both sexes and specified age class and flush them into the recycling pool.
Container sizes are reset to null values.
AGE | the index of the age class to be flushed |
|
inline |
Removes all individual pointers of both sexes and specified age class(es) and flush them into the recycling pool.
Container sizes are reset to null values.
AGE | the age class(es) to be flushed |
Removes all individual pointers of the appropriate sex and age class and flush them into the recycling pool.
Container sizes are reset to null values.
SEX | the sex class of the individual |
AGE | the index of the age class to be flushed |
|
inline |
Returns a pointer to the appropriate individual.
SEX | sex class container index |
AGE | age class container index |
at | the index of the individual in its container |
deme | the patch where to grab the individual |
References Patch::get(), and getPatchPtr().
Referenced by LCE_Cross::create_individual_ancestors(), LCE_NtrlInit::init_allele_freq(), LCE_QuantiInit::init_allele_freq(), LCE_QuantiInit::init_trait_value(), LCE_Init_BDMI::init_value(), move(), read_trait(), store_data(), and store_trait().
void Metapop::getAllIndividuals | ( | age_idx | AGE, |
deque< Individual * > & | fem_pool, | ||
deque< Individual * > & | mal_pool | ||
) |
References _vPatch, FEM, MAL, and size().
Referenced by setPopulationFromSource().
|
inline |
References _currentAge.
Referenced by LCE_Resize::execute(), LCE_Resize::fillPop(), FileServices::getSampledPop(), loadSourcePopulation(), StatServices::recordStats(), setPopulationFromSourceInPreserveMode(), TTNeutralGenesFH::write_PLINK(), TTQuantiFH::write_PLINK(), TTQuantiFH::write_TABLE(), and TTNeutralGenesFH::write_varcompWC().
|
inline |
References _currentGeneration.
Referenced by BinaryDataSaver::execute(), LCE_Cross::execute(), LCE_Resize::execute(), LCE_QuantiInit::execute(), LCE_QuantiModifier::execute(), LCE_Selection_base::execute(), LCE_ParamUpdaterNotifier::execute(), LCE_Init_BDMI::execute(), LCE_NtrlInit::execute(), LCE_Breed_Wolbachia::execute(), TTQFreqExtractor::FHwrite(), FileServices::getGenerationCounter(), FileServices::getSampledPop(), BinaryDataSaver::printOffsetTable(), LCE_Selection_base::set_std_rate_of_change(), TTNeutralGenesSH::setAlleleTables(), LCE_SelectionSH::setDataTable(), TTQuantiSH::setStats(), LCE_Breed_Quanti::setVefromVa(), BinaryDataSaver::storeData(), FileHandler::update(), and LCE_Resize::updateParameters().
|
inline |
References _currentReplicate.
Referenced by LCE_Breed_Wolbachia::execute(), BinaryDataSaver::finish(), LCE_Cross::generatePedigree(), FileServices::getReplicateCounter(), FileServices::getSampledPop(), TTNeutralGenesSH::setAlleleTables(), LCE_SelectionSH::setDataTable(), TTQuantiSH::setStats(), and FileHandler::update().
|
inline |
References _generations.
Referenced by TTQFreqExtractor::FHwrite(), FileServices::getGenerationCounter(), BinaryDataSaver::ifExist(), FileHandler::ifExist(), FileHandler::init(), and BinaryDataSaver::setParameters().
Patch accessor, return the ith+1 patch in the metapop.
References _vPatch.
Referenced by LCE_Selection_base::addPhenotypicSD(), LCE_Breed_Selection_Disperse::breed_selection_disperse(), LCE_Breed_Disperse::do_breed_disperse(), LCE_Disperse_EvolDisp::evoldisp(), LCE_Breed_Disperse::execute(), LCE_Breed_Selection::execute(), LCE_Breed_Selection_Disperse::execute(), LCE_Disperse_ConstDisp::execute(), LCE_Disperse_EvolDisp::execute(), LCE_Regulation::execute(), LCE_Aging::execute(), LCE_Patch_Extinction::execute(), LCE_Cross::execute(), LCE_QuantiModifier::execute(), LCE_Selection_base::execute(), TTDeletMutBitstrFH::FHread(), TTNeutralGenesFH::FHread(), TTQuantiFH::FHread(), LCE_SelectionFH::FHwrite(), MPFileHandler::FHwrite(), TTBDMI_FH::FHwrite(), TTDeletMutBitstrFH::FHwrite(), TTQFreqExtractor::FHwrite(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Cross::generatePedigree(), MPStatHandler::getEmigrantInPatch(), MPStatHandler::getImigrateInPatch(), MPStatHandler::getKolonisersInPatch(), TTDeletMutBitstrSH::getLoad(), LCE_Selection_base::getMaxPatchFitness(), MPStatHandler::getMeanAssignedFecundity(), TTDispersalSH::getMeanDispRate(), MPStatHandler::getMeanEmigrantPerPatch(), TTDeletMutBitstrSH::getMeanFecWithPatchMate(), TTWolbachiaSH::getMeanFemaleInfection_perPatch(), TTDispersalSH::getMeanFemDispRate(), LCE_Selection_base::getMeanFitness(), MPStatHandler::getMeanImigrantPerPatch(), MPStatHandler::getMeanKolonisersPerPatch(), MPStatHandler::getMeanKolonisersProportion(), TTDispersalSH::getMeanMalDispRate(), TTWolbachiaSH::getMeanMaleInfection_perPatch(), MPStatHandler::getMeanMatings(), TTWolbachiaSH::getMeanOffsprgFemaleInfection_perPatch(), TTWolbachiaSH::getMeanOffsprgInfection(), TTWolbachiaSH::getMeanOffsprgMaleInfection_perPatch(), MPStatHandler::getMeanPatchAge(), MPStatHandler::getMeanPatchDensity(), MPStatHandler::getMeanPatchDensityVariance(), LCE_Selection_base::getMeanPatchFitness(), MPStatHandler::getMeanResidantPerPatch(), TTDispersalSH::getOffsprgMeanDispRate(), MPStatHandler::getPatchAge(), TTDeletMutBitstrSH::getPatchLoad(), MPStatHandler::getResidantInPatch(), FileServices::getSampledPop(), LCE_Breed_Wolbachia::hasInfectedFemale(), LCE_Breed_Wolbachia::inoculate_wolbachia(), LCE_Disperse_ConstDisp::Migrate(), LCE_Disperse_ConstDisp::MigratePatch(), LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder(), LCE_Disperse_ConstDisp::MigratePatchByNumber(), LCE_Breed_base::NonWrightFisherPopulation(), LCE_Breed_Quanti::NonWrightFisherPopulation(), TTQuantiFH::print(), LCE_Disperse_base::reset_counters(), LCE_Selection_base::set_std_rate_of_change(), TTNeutralGenesSH::setAdults_Theta(), TTNeutralGenesSH::setAlleleTables(), TTNeutralGenesSH::setCoaMatrix(), LCE_SelectionSH::setDataTable(), TTQuantiSH::setDataTables(), TTDeletMutBitstrSH::setDeletStats(), TTDeletMutBitstrSH::setFst(), TTNeutralGenesSH::setHeteroTable(), TTNeutralGenesSH::setHeterozygosity(), TTNeutralGenesSH::setHo(), TTNeutralGenesSH::setHo2(), TTNeutralGenesSH::setHs(), TTNeutralGenesSH::setHs2(), TTWolbachiaSH::setInfectionStats(), MPStatHandler::setKinship(), TTDeletMutBitstrSH::setMeanViability(), MPStatHandler::setObsrvdExtinctionRate(), MPStatHandler::setPedegreeCount(), MPStatHandler::setReproductiveStats(), TTNeutralGenesSH::setSibStats(), TTBDMI_SH::setStats(), TTDeletMutBitstrSH::setViability(), size(), LCE_Disperse_base::swapPostDisp(), LCE_Breed_Wolbachia::wolbachia_model_1(), LCE_Breed_Wolbachia::wolbachia_model_2(), LCE_Breed_base::WrightFisherPopulation(), LCE_Breed_Quanti::WrightFisherPopulation(), TTNeutralGenesFH::write_FSTAT(), TTNeutralGenesFH::write_GENEPOP(), TTNeutralGenesFH::write_PLINK(), TTQuantiFH::write_PLINK(), TTNeutralGenesFH::write_PLINK_BED(), and TTNeutralGenesFH::write_TAB().
|
inline |
References _vPatch.
Referenced by LCE_Resize::buildNewPatchArrayWithBackup(), LCE_Resize::execute(), FileServices::getSampledPop(), and LCE_Resize::removeDesignatedPatch().
|
inline |
References _patchSizes.
Referenced by FileServices::getSampledPop(), and LCE_Resize::updatePatchCapacities().
References _patchSizes, and TMatrix::get().
|
inline |
References _patchKfem.
Referenced by LCE_Resize::execute().
|
inline |
References _patchKmal.
Referenced by LCE_Resize::execute().
|
inline |
References _patchNbr.
Referenced by TTQuantiSH::addAvgPerPatch(), TTQuantiSH::addCovarPerPatch(), TTDispersalSH::addDispPerPatch(), TTQuantiSH::addEigenPerPatch(), TTQuantiSH::addEigenValuesPerPatch(), TTQuantiSH::addEigenVect1PerPatch(), MPStatHandler::addIndNumPerPatch(), LCE_SelectionSH::addMeanPerPatch(), MPStatHandler::addPatchAge(), TTQuantiSH::addQuanti(), TTQuantiSH::addSkewPerPatch(), TTBDMI_SH::addStats(), LCE_SelectionSH::addVarPerPatch(), TTQuantiSH::addVarPerPatch(), TTNeutralGenesSH::allocateTables(), LCE_Breed_Selection_Disperse::breed_selection_disperse(), LCE_Resize::buildNewPatchArrayWithBackup(), LCE_Breed_Disperse::do_breed_disperse(), LCE_Breed::execute(), LCE_Breed_Disperse::execute(), LCE_Breed_Selection::execute(), LCE_Breed_Selection_Disperse::execute(), LCE_Disperse_ConstDisp::execute(), LCE_Disperse_EvolDisp::execute(), LCE_Regulation::execute(), LCE_Aging::execute(), LCE_Patch_Extinction::execute(), LCE_Cross::execute(), LCE_Resize::execute(), LCE_QuantiInit::execute(), LCE_QuantiModifier::execute(), LCE_Breed_Quanti::execute(), LCE_Selection_base::execute(), LCE_Init_BDMI::execute(), LCE_NtrlInit::execute(), TTDeletMutBitstrFH::FHread(), TTNeutralGenesFH::FHread(), TTQuantiFH::FHread(), LCE_SelectionFH::FHwrite(), MPFileHandler::FHwrite(), TTBDMI_FH::FHwrite(), TTDeletMutBitstrFH::FHwrite(), TTQFreqExtractor::FHwrite(), LCE_Resize::fillPop(), TTNeutralGenesSH::getDxy(), TTDeletMutBitstrSH::getLoad(), LCE_Selection_base::getMaxFitness(), MPStatHandler::getMeanAssignedFecundity(), TTDispersalSH::getMeanDispRate(), MPStatHandler::getMeanEmigrantPerPatch(), TTDeletMutBitstrSH::getMeanFecWithPatchMate(), TTDispersalSH::getMeanFemDispRate(), LCE_Selection_base::getMeanFitness(), MPStatHandler::getMeanImigrantPerPatch(), MPStatHandler::getMeanKolonisersPerPatch(), MPStatHandler::getMeanKolonisersProportion(), TTDispersalSH::getMeanMalDispRate(), MPStatHandler::getMeanMatings(), TTWolbachiaSH::getMeanOffsprgInfection(), MPStatHandler::getMeanPatchAge(), MPStatHandler::getMeanPatchDensity(), MPStatHandler::getMeanPatchDensityVariance(), MPStatHandler::getMeanPatchSize(), MPStatHandler::getMeanPatchSizePerSex(), MPStatHandler::getMeanResidantPerPatch(), TTDispersalSH::getOffsprgMeanDispRate(), FileServices::getSampledPop(), LCE_Breed_Wolbachia::hasInfectedFemale(), TTQuantiSH::init(), LCE_Breed_Wolbachia::inoculate_wolbachia(), LCE_Breed_Disperse::mate_selfing(), LCE_Breed_base::NonWrightFisherPopulation(), LCE_Breed_Quanti::NonWrightFisherPopulation(), TTQuantiFH::print(), LCE_Resize::regulate(), LCE_Cross::sampleAmongPop(), LCE_Selection_base::set_local_optima(), LCE_Patch_Extinction::set_matrix_param(), LCE_Selection_base::set_param_rate_of_change(), LCE_Selection_base::set_std_rate_of_change(), TTNeutralGenesSH::setAdults_Theta(), TTNeutralGenesSH::setAlleleTables(), LCE_Disperse_base::setBaseParameters(), TTNeutralGenesSH::setCoaMatrix(), TTNeutralGenesSH::setCoaMatrixRecorders(), LCE_SelectionSH::setDataTable(), TTQuantiSH::setDataTables(), TTDeletMutBitstrSH::setDeletStats(), TTNeutralGenesSH::setDxyRecorders(), LCE_Breed_base::setFecundity(), TTDeletMutBitstrSH::setFst(), TTNeutralGenesSH::setFst_li(), TTNeutralGenesSH::setFstat(), TTNeutralGenesSH::setFstat2(), TTNeutralGenesSH::setFstatWeirCockerham(), TTNeutralGenesSH::setFstatWeirCockerham_MS(), TTNeutralGenesSH::setFstMatrix(), TTNeutralGenesSH::setFstMatrixRecorders(), TTNeutralGenesSH::setHeteroTable(), TTNeutralGenesSH::setHeterozygosity(), TTNeutralGenesSH::setHo(), TTNeutralGenesSH::setHo2(), TTNeutralGenesSH::setHs(), TTNeutralGenesSH::setHs2(), TTWolbachiaSH::setInfectionStats(), MPStatHandler::setKinship(), TTNeutralGenesSH::setLociDivCounter(), TTDeletMutBitstrSH::setMeanViability(), TTNeutralGenesSH::setNeiGeneticDistance(), TTNeutralGenesSH::setNeiGeneticDistanceRecorders(), MPStatHandler::setObsrvdExtinctionRate(), LCE_Breed_Disperse::setParameters(), LCE_Disperse_EvolDisp::setParameters(), LCE_QuantiInit::setParameters(), LCE_Init_BDMI::setParameters(), LCE_NtrlInit::setParameters(), LCE_Breed_Wolbachia::setParameters(), MPStatHandler::setPedegreeCount(), setPopulationFromSourceInPreserveMode(), LCE_Disperse_base::setPropaguleTargets(), MPStatHandler::setReproductiveStats(), LCE_Selection_base::setSelectionMatrix(), TTNeutralGenesSH::setSibStats(), TTWolbachiaSH::setStatRecorders(), TTBDMI_SH::setStats(), TTQuantiSH::setStats(), MPStatHandler::setStatsForMigrantsPerPatch(), TTDeletMutBitstrSH::setViability(), LCE_Resize::updateParameters(), LCE_Resize::updatePatchCapacities(), LCE_Breed_Wolbachia::wolbachia_model_1(), LCE_Breed_Wolbachia::wolbachia_model_2(), LCE_Breed_base::WrightFisherPopulation(), LCE_Breed_Quanti::WrightFisherPopulation(), TTNeutralGenesFH::write_Fst_i(), TTNeutralGenesFH::write_FSTAT(), TTNeutralGenesFH::write_GENEPOP(), TTNeutralGenesFH::write_PLINK(), TTQuantiFH::write_PLINK(), TTNeutralGenesFH::write_PLINK_BED(), TTNeutralGenesFH::write_TAB(), and TTNeutralGenesFH::write_varcompWC().
A secure version of the getPatch() method.
References _vPatch, and fatal().
Referenced by LCE_Resize::buildNewPatchArrayWithBackup(), LCE_Resize::fillPatchNoBackup(), LCE_Resize::fillPatchWithBackup(), get(), LCE_Breed_Disperse::get_parent(), TTNeutralGenesSH::getDxyPerPatch(), TTDispersalSH::getMeanDispRateInPatch(), LCE_SelectionSH::getMeanPatchFitness(), LCE_SelectionSH::getVarPatchFitness(), LCE_Resize::regulate(), LCE_Resize::removeDesignatedPatch(), removePatch(), LCE_Cross::sampleAmongPop(), setPopulationFromSourceInPreserveMode(), and LCE_Resize::updatePatchCapacities().
|
inline |
References _replicates.
Referenced by FileServices::getFirstReplicateFileName(), FileServices::getReplicateCounter(), BinaryDataSaver::ifExist(), FileHandler::ifExist(), and FileHandler::init().
|
inline |
References _source_filetype.
Referenced by SimRunner::run().
|
inline |
References _source_name.
Referenced by SimRunner::run().
|
inline |
References _source_replicate_digits.
bool Metapop::init | ( | ) |
Inits the population parameters from the ParamSet and builds the pop (adds patches), the prototypes and the life cycle.
Called at the start of each simulation, resets the individual garbage collector.
References SimComponent::_paramSet, buildPatchArray(), error(), ParamSet::isSet(), IndFactory::purgeRecyclingPOOL(), and setParameters().
Referenced by SimRunner::init_components().
|
inline |
Checks if the population still contains at least one individual in any sex or age class.
References size().
Referenced by SimRunner::Cycle(), MPFileHandler::FHwrite(), TTBDMI_FH::FHwrite(), TTNeutralGenesFH::FHwrite(), TTQuantiFH::FHwrite(), and SimRunner::Replicate_LOOP().
|
inline |
References _source_load.
Referenced by SimRunner::run().
|
virtual |
Implements SimComponent.
References _writer, FileServices::attach(), fatal(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Param::getMatrix(), Param::getValue(), Param::isMatrix(), Param::isSet(), FileHandler::set(), FileHandler::set_multi(), MPFileHandler::setOption(), and size().
void Metapop::loadPopFromBinarySource | ( | string & | filename | ) |
Loads the population from a binary data file when setting the first generation of a replicate.
References _currentReplicate, SimRunner::_FileServices, _loader, _source, _source_generation, _source_param_override, BinaryDataLoader::extractPop(), fatal(), SimBuilder::get_current_event(), SimBuilder::get_current_eventWithParameter(), SimBuilder::get_current_trait(), SimBuilder::get_current_traitWithParameter(), SimComponent::get_parameter(), Param::getArg(), IndFactory::getNewIndividual(), BinaryDataLoader::getPop(), BinaryDataLoader::getSim(), SimComponent::has_parameter(), tstring::int2str(), FileServices::log(), SIMenv::MainSim, message(), resetParameterFromSource(), and SimComponent::resetParameterFromSource().
Referenced by loadSourcePopulation().
void Metapop::loadPopFromTraitFile | ( | string & | filename | ) |
Loads a population from a trait's data file (text file).
References _currentAge, _source, _source_filetype, ADULTS, fatal(), FileHandler::FHread(), SimRunner::get_FileServices(), FileServices::getReader(), SIMenv::MainSim, OFFSPRG, FileHandler::set_pop_ptr(), and size().
Referenced by loadSourcePopulation().
void Metapop::loadSourcePopulation | ( | ) |
Loads a population from a soure population.
References _currentReplicate, _replicates, _source, _source_filetype, _source_load_periodicity, _source_name, _source_replicate_digits, _source_replicates, _source_start_at_replicate, ADULTS, fatal(), FEM, getCurrentAge(), loadPopFromBinarySource(), loadPopFromTraitFile(), MAL, message(), OFFSPRG, setCurrentAge(), and size().
Referenced by setPopulation().
|
inlinevirtual |
Implements SimComponent.
References _statHandler, and StatServices::attach().
|
inline |
Moves an individual from a deme to an other one, both demes sizes are modified.
SEX | sex class container index |
from_age | age class container index in the deme of origin |
from_deme | index of the deme of origin |
to_age | age class container index in the destination deme |
to_deme | index of the destination deme |
at | index of the focal individual in the 'from' deme |
References _vPatch, and get().
Referenced by LCE_Disperse_EvolDisp::evoldisp(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Disperse_ConstDisp::MigratePatch(), LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder(), and LCE_Disperse_ConstDisp::MigratePatchByNumber().
void Metapop::read_trait | ( | int | trait_idx, |
BinaryStorageBuffer * | loader | ||
) |
Iterates through the individuals containers to retrieve the trait data from a binary file.
References _patchNbr, _vPatch, ADLTx, FEM, get(), Individual::getTrait(), MAL, OFFSx, and StorableComponent::retrieve_data().
Referenced by retrieve_data().
Removes a patch from the patch array and returns it pointer.
The patch and its content are NOT deleted. The IDs of the remaining patches are NOT updated.
i | the index of the patch to remove. |
References _vPatch, and getPatchPtr().
Referenced by LCE_Resize::buildNewPatchArrayWithBackup(), FileServices::getSampledPop(), and LCE_Resize::removeDesignatedPatch().
void Metapop::reset | ( | ) |
Called to empty the patches, individuals are move to the garbage collector.
Resets each Patch, all individuals are moved to the POOL.
References _patchNbr, and _vPatch.
Referenced by LCE_Breed_Wolbachia::execute().
|
inlinevirtual |
Implements SimComponent.
Referenced by loadPopFromBinarySource().
void Metapop::resizePatchArray | ( | ) |
Resets the patch container to the right number of patches as set by _patchNbr.
Called at the beginning of each new simulation. Extra patches are destroyed and new ones are added if missing.
References _patchNbr, and _vPatch.
Referenced by buildPatchArray(), and updatePatchArray().
|
virtual |
Implements StorableComponent.
References _patchNbr, IndFactory::_protoTraits, _vPatch, ADLTx, error(), FEM, BinaryStorageBuffer::getBytesOut(), IndFactory::getNewIndividual(), Individual::getSex(), MAL, message(), OFFSx, BinaryStorageBuffer::read(), read_trait(), Individual::retrieve_data(), size(), and TRAIT_T_MAX.
Referenced by BinaryDataLoader::extractPop().
|
inline |
Sets the age flag.
age | the current age. |
References _currentAge.
Referenced by LCE_Cross::generatePedigree(), FileServices::getSampledPop(), loadSourcePopulation(), and SimRunner::step().
void Metapop::setCurrentAge | ( | LifeCycleEvent * | LCE | ) |
Set the age flag from a LifeCycleEvent object.
LCE | the LifeCycleEvent object. |
References _currentAge, LifeCycleEvent::addAgeClass(), and LifeCycleEvent::removeAgeClass().
|
inline |
References _currentGeneration.
Referenced by SimRunner::Cycle(), SimRunner::Replicate_LOOP(), SimRunner::setCurrentGeneration(), and SimRunner::setForFirstGeneration().
|
inline |
References _currentReplicate.
Referenced by SimRunner::Replicate_LOOP(), and SimRunner::setCurrentReplicate().
|
inline |
References _generations.
Referenced by SimRunner::init_components(), and SimRunner::setGenerations().
|
inline |
References _mpimgr.
Referenced by BinaryDataLoader::extractPop().
|
virtual |
Implements SimComponent.
References setPopulationParameters(), and setSourceParameters().
Referenced by BinaryDataLoader::extractPop(), and init().
void Metapop::setPatchCapacities | ( | ) |
Sets the deme capacity matrix from parameter values.
References _patchKfem, _patchKmal, _patchNbr, _patchSizes, FEM, MAL, TMatrix::reset(), and TMatrix::set().
Referenced by setPopulationParameters().
void Metapop::setPatchCapacities | ( | sex_t | SEX, |
string | param | ||
) |
Builds the new population from a matrix of deme sizes but for one sex only.
Sizes for the other sex class(es) must be given separately.
SEX | the sex class of the given deme sizes. |
param | the name of the parameter to take the matrix argument from. |
References SimComponent::_paramSet, _patchKfem, _patchKmal, _patchNbr, _patchSizes, FEM, TMatrix::get(), ParamSet::getMatrix(), TMatrix::length(), TMatrix::reset(), and TMatrix::set().
void Metapop::setPatchCapacities | ( | string | param | ) |
Builds the new population from a single matrix of deme sizes.
The sex-specific patch capacities will be half of the numbers given in the matrix.
param | the name of the parameter to take the matrix argument from. |
References SimComponent::_paramSet, _patchNbr, _patchSizes, FEM, TMatrix::get(), ParamSet::getMatrix(), TMatrix::length(), MAL, TMatrix::reset(), and TMatrix::set().
void Metapop::setPatchCapacities | ( | string | paramfem, |
string | parammal | ||
) |
Builds the new population from matrices of deme sizes.
paramfem | the name of the parameter to take the matrix argument from. |
parammal | the name of the parameter to take the matrix argument from. |
References SimComponent::_paramSet, _patchNbr, _patchSizes, FEM, TMatrix::get(), ParamSet::getMatrix(), TMatrix::length(), MAL, TMatrix::reset(), TMatrix::set(), and warning().
|
inline |
References _patchNbr.
Referenced by FileServices::getSampledPop().
|
inline |
References _patchSizes, and TMatrix::copy().
Referenced by FileServices::getSampledPop().
Sets the population for the first generation of each replicates.
References _currentAge, _currentReplicate, _patchNbr, _requiredAge, _source_filetype, _source_load, _source_load_periodicity, _source_preserve, _source_replicates, _vPatch, buildPatchArray(), SimBuilder::getFirstRequiredAgeInLifeCycle(), loadSourcePopulation(), SIMenv::MainSim, message(), NONE, IndFactory::purgeRecyclingPOOL(), setPopulationFromSource(), setPopulationFromSourceInPreserveMode(), setPopulationParameters(), size(), and warning().
Referenced by SimRunner::setForFirstGeneration().
void Metapop::setPopulationFromSource | ( | ) |
References _currentAge, _requiredAge, _source, ADLTx, ADULTS, FEM, fillPopulationFromSource(), getAllIndividuals(), MAL, OFFSPRG, OFFSx, size(), and warning().
Referenced by setPopulation().
void Metapop::setPopulationFromSourceInPreserveMode | ( | ) |
References _currentAge, _requiredAge, _source, _vPatch, ADULTS, ALL, FEM, fillPatchFromSource(), getCurrentAge(), getPatchNbr(), getPatchPtr(), MAL, message(), NONE, OFFSPRG, size(), and warning().
Referenced by setPopulation().
bool Metapop::setPopulationParameters | ( | ) |
Population's size parameters initializing procedure.
References SimComponent::_paramSet, _patchK, _patchKfem, _patchKmal, _patchNbr, error(), FEM, ParamSet::getValue(), ParamSet::isMatrix(), ParamSet::isSet(), MAL, and setPatchCapacities().
Referenced by LCE_Resize::execute(), setParameters(), setPopulation(), and updatePopulationParameters().
|
inline |
References _replicates.
Referenced by SimRunner::init_components(), and SimRunner::setReplicates().
bool Metapop::setSourceParameters | ( | ) |
Setter for source population parameters.
References SimComponent::_paramSet, _requiredAge, _source, _source_filetype, _source_generation, _source_load, _source_name, _source_param_override, _source_preserve, _source_replicate_digits, _source_replicates, _source_required_age, _source_start_at_replicate, ADULTS, ALL, SimComponent::get_parameter(), ParamSet::getArg(), Param::getMultiArgs(), ParamSet::getValue(), Param::hasMultipleArgs(), ParamSet::isSet(), NONE, and OFFSPRG.
Referenced by Metapop(), and setParameters().
void Metapop::show_up | ( | ) |
References _patchK, _patchKfem, _patchKmal, _patchNbr, _patchSizes, _vPatch, message(), show_up(), TMatrix::show_up(), and size().
Referenced by FileServices::getSampledPop(), and show_up().
|
inline |
Get the total number of individuals present in the population, all sex and age classes together.
Referenced by LCE_Cross::create_individual_ancestors(), LCE_Breed::execute(), LCE_Breed_Disperse::execute(), LCE_Breed_Selection::execute(), LCE_Breed_Selection_Disperse::execute(), LCE_Disperse_ConstDisp::execute(), LCE_Disperse_EvolDisp::execute(), LCE_Regulation::execute(), LCE_Aging::execute(), LCE_Cross::execute(), LCE_Resize::execute(), LCE_QuantiInit::execute(), LCE_Breed_Quanti::execute(), LCE_Selection_base::execute(), LCE_Init_BDMI::execute(), LCE_NtrlInit::execute(), LCE_Breed_Wolbachia::execute(), MPStatHandler::getAdultSexRatio(), getAllIndividuals(), TTNeutralGenesSH::getDxy(), MPStatHandler::getFemNumber(), MPStatHandler::getMalNumber(), TTDispersalSH::getMeanFemDispRate(), LCE_Selection_base::getMeanFitness(), TTDispersalSH::getMeanMalDispRate(), TTWolbachiaSH::getMeanOffsprgInfection(), MPStatHandler::getMeanPatchDensity(), MPStatHandler::getMeanPatchDensityVariance(), MPStatHandler::getMeanPatchSize(), MPStatHandler::getMeanPatchSizePerSex(), MPStatHandler::getOffFemNumber(), MPStatHandler::getOffMalNumber(), TTDispersalSH::getOffsprgMeanDispRate(), MPStatHandler::getOffsprgSexRatio(), MPStatHandler::getPatchSize(), MPStatHandler::getPopulationSize(), FileServices::getSampledPop(), isAlive(), loadFileServices(), loadPopFromTraitFile(), loadSourcePopulation(), LCE_Breed_base::NonWrightFisherPopulation(), LCE_Breed_Quanti::NonWrightFisherPopulation(), retrieve_data(), TTNeutralGenesSH::setAlleleTables(), LCE_SelectionSH::setDataTable(), TTQuantiSH::setDataTables(), TTNeutralGenesSH::setFst_li(), TTNeutralGenesSH::setFstat(), TTNeutralGenesSH::setFstat2(), TTNeutralGenesSH::setFstatWeirCockerham(), TTNeutralGenesSH::setFstatWeirCockerham_MS(), TTNeutralGenesSH::setFstMatrix(), TTNeutralGenesSH::setHo2(), TTNeutralGenesSH::setHs2(), TTWolbachiaSH::setInfectionStats(), MPStatHandler::setKinship(), TTDeletMutBitstrSH::setLethalEquivalents(), TTNeutralGenesSH::setLociDivCounter(), TTNeutralGenesSH::setNeiGeneticDistance(), setPopulation(), setPopulationFromSource(), setPopulationFromSourceInPreserveMode(), MPStatHandler::setReproductiveStats(), TTQuantiSH::setStats(), show_up(), size(), store_data(), LCE_Breed_base::WrightFisherPopulation(), LCE_Breed_Quanti::WrightFisherPopulation(), TTNeutralGenesFH::write_Fst_i(), TTNeutralGenesFH::write_PLINK_BED(), and TTNeutralGenesFH::write_varcompWC().
Interface to get the size of a praticular age and sex class within a patch.
AGE | age class flags |
SEX | sex class |
deme | the focal patch |
References getPatch(), and Patch::size().
|
virtual |
Implements StorableComponent.
References _patchNbr, _vPatch, ADLTx, ADULTS, FEM, get(), BinaryStorageBuffer::getTotByteRecorded(), IndFactory::getTraitPrototypes(), MAL, message(), OFFSPRG, OFFSx, size(), BinaryStorageBuffer::store(), Individual::store_data(), store_trait(), and TRAIT_T_MAX.
Referenced by BinaryDataSaver::storeData().
void Metapop::store_trait | ( | int | trait_idx, |
BinaryStorageBuffer * | saver | ||
) |
Iterates through the individuals containers to store the trait data to a binary file.
References _patchNbr, _vPatch, ADLTx, FEM, get(), Individual::getTrait(), MAL, OFFSx, and StorableComponent::store_data().
Referenced by store_data().
void Metapop::updatePatchArray | ( | ) |
Called during simulation to modify the meta-population size.
Patch number and capacities are updated, new patches are empty, existing patches containers are untouched.
References resizePatchArray(), and updatePatchState().
Referenced by LCE_Resize::buildNewPatchArrayNoBackup(), and updatePopulationParameters().
void Metapop::updatePatchState | ( | ) |
Update the patch capacities and patch ID (reset to array position).
References _patchNbr, _patchSizes, _vPatch, FEM, TMatrix::get(), and MAL.
Referenced by LCE_Resize::buildNewPatchArrayWithBackup(), and updatePatchArray().
bool Metapop::updatePopulationParameters | ( | ) |
Called during simulation to change the population's parameters (temporal argument).
References setPopulationParameters(), and updatePatchArray().
Referenced by Metapop().
|
friend |
|
private |
The current age class, might be changed by the LCEs.
Referenced by getCurrentAge(), loadPopFromTraitFile(), setCurrentAge(), setPopulation(), setPopulationFromSource(), and setPopulationFromSourceInPreserveMode().
|
private |
The current generation in the generation loop, starts at 1.
Referenced by getCurrentGeneration(), and setCurrentGeneration().
|
private |
The current replicate in the replicate loop, starts at 1.
Referenced by getCurrentReplicate(), loadPopFromBinarySource(), loadSourcePopulation(), setCurrentReplicate(), and setPopulation().
|
private |
Number of generations to iterate.
Referenced by getGenerations(), and setGenerations().
|
private |
A BinaryDataLoader to load a population from a binary data file.
Referenced by loadPopFromBinarySource().
|
private |
Referenced by BinaryDataLoader::extractPop(), and setMPImanager().
|
private |
Patch carrying capacity.
Referenced by getPatchCapacity(), setPopulationParameters(), and show_up().
|
private |
Sex specific carrying capacities.
Referenced by getPatchKFem(), setPatchCapacities(), setPopulationParameters(), and show_up().
|
private |
Referenced by getPatchKMal(), setPatchCapacities(), setPopulationParameters(), and show_up().
|
private |
Number of patches in the population.
Referenced by buildPatchArray(), clear(), fillPopulationFromSource(), flush(), getPatchNbr(), read_trait(), reset(), resizePatchArray(), retrieve_data(), setPatchCapacities(), setPatchNbr(), setPopulation(), setPopulationParameters(), show_up(), size(), store_data(), store_trait(), and updatePatchState().
|
private |
Matrix of the deme sizes, row 0 for the males, row 1 for the females.
Referenced by buildPatchArray(), getPatchCapacities(), getPatchCapacity(), setPatchCapacities(), setPatchSizes(), show_up(), and updatePatchState().
|
private |
Number of replicates to iterate.
Referenced by getReplicates(), loadSourcePopulation(), and setReplicates().
|
private |
The age class flag that is required to fill the population at the beginning of a replicate.
Referenced by fillPatchFromSource(), setPopulation(), setPopulationFromSource(), setPopulationFromSourceInPreserveMode(), and setSourceParameters().
|
private |
A source population as loaded from a binary data file, used to build a population.
Referenced by clear(), loadPopFromBinarySource(), loadPopFromTraitFile(), loadSourcePopulation(), setPopulationFromSource(), setPopulationFromSourceInPreserveMode(), and setSourceParameters().
|
private |
The trait type to load from.
Referenced by clear(), getSourceFileType(), loadPopFromTraitFile(), loadSourcePopulation(), setPopulation(), and setSourceParameters().
|
private |
The generation to load from the binary file source file.
Referenced by loadPopFromBinarySource(), and setSourceParameters().
|
private |
Flage to specify that the population should be built from the binary loaded source population.
Referenced by isSourceLoad(), setPopulation(), and setSourceParameters().
|
private |
The number of replicates to source from a single source replicate.
Referenced by loadSourcePopulation(), and setPopulation().
|
private |
The base filename of source population files.
Referenced by getSourceName(), loadSourcePopulation(), and setSourceParameters().
|
private |
List of parameters whose values in the source should override local values in the loading pop.
Referenced by loadPopFromBinarySource(), and setSourceParameters().
|
private |
Flag to specify the loading mode, true means the source pop is the actual population.
Referenced by setPopulation(), and setSourceParameters().
|
private |
Number of digits in the replicate counter filename extension.
Referenced by getSourceReplDigits(), loadSourcePopulation(), and setSourceParameters().
|
private |
The number of source files, each file being a different replicate of the source population.
Used to automatically build the source filename.
Referenced by loadSourcePopulation(), setPopulation(), and setSourceParameters().
|
private |
The age class to fill with the source population.
Referenced by setSourceParameters().
|
private |
The replicate number to start loading from.
Referenced by loadSourcePopulation(), and setSourceParameters().
|
private |
The stat handler for the population stats.
Referenced by loadStatServices().
|
private |
The Patch container.
Referenced by addPatch(), buildPatchArray(), clear(), deletePatch(), fillPopulationFromSource(), flush(), getAllIndividuals(), getPatch(), getPatchArray(), getPatchArraySize(), getPatchPtr(), move(), read_trait(), removePatch(), reset(), resizePatchArray(), retrieve_data(), setPopulation(), setPopulationFromSourceInPreserveMode(), show_up(), size(), store_data(), store_trait(), and updatePatchState().
|
private |
The file handler used to save pedigree info.
Referenced by loadFileServices().