|
Nemo
2.2.0
|
Second class in the metapopulation design structure, between the Metapop and Individual classes. More...
#include <metapop.h>
Public Member Functions | |
| Patch () | |
| ~Patch () | |
| Patch * | init (unsigned int nbfem, unsigned int nbmal, unsigned int id) |
| unsigned int | size (age_t AGE) |
| Returns the size of the container of the appropriate age class(es) for both sexes. | |
| unsigned int | size (sex_t SEX, age_t AGE) |
| Returns the size of the container for the appropriate sex and age classes present in the age flag. | |
| unsigned int | size (sex_t SEX, age_idx AGE) |
| Returns the size of the container for the appropriate sex and age class. | |
| unsigned int | size (age_idx AGE) |
| Returns the size of the container for the appropriate age class for both sexes. | |
| Individual * | get (sex_t SEX, age_idx AGE, unsigned int at) |
| Returns a pointer to the individual sitting at the index passed. | |
| void | set (sex_t SEX, age_idx AGE, unsigned int at, Individual *ind) |
| Modifies the appropriate container with value of the pointer given. | |
| void | add (sex_t SEX, age_idx AGE, Individual *ind) |
| Adds an individual to the appropriate container, increments its size, eventually resizing it. | |
| void | assign (sex_t SEX, age_idx AGE, unsigned int n) |
| Assigns a new container of given size for the sex and age class passed, sets all values to NULL. | |
| Individual * | remove (sex_t SEX, age_idx AGE, unsigned int at) |
| Removes the individual sitting at the given index in the appropriate container. | |
| void | move (sex_t SEX, age_idx from, age_idx to, unsigned int at) |
| Moves an individual from an age class to an other one. | |
| void | swap (sex_t SEX, age_idx from, age_idx to) |
| Copies all elements in the 'from' age-class container to the 'to' age-class container of the same sex. | |
| void | clear (sex_t SEX, age_idx AGE) |
| Sets the size of the appropriate container to zero. | |
| void | clear () |
| void | flush (sex_t SEX, age_idx AGE, Metapop *pop) |
| Removes all individual pointers of the appropriate sex and age class and flush them into the recycling pool. | |
| void | flush (age_idx AGE, Metapop *pop) |
| void | flush (age_t AGE, Metapop *pop) |
| Removes all individual pointers of the appropriate sex and age class and flush them into the recycling pool. | |
| void | flush (Metapop *pop) |
| Removes all individual pointers of all sex and age classes and flush them into the recycling pool. | |
| void | getCopy (sex_t SEX, age_idx AGE, deque< Individual * > &to) |
| void | copy2patch (sex_t from_sex, sex_t to_sex, age_idx from_age, age_idx to_age, Patch *to_patch) |
| void | copy2patch (sex_t SEX, age_idx AGE, Patch *patch) |
| void | copy2patch (age_idx AGE, Patch *patch) |
| void | copy2patch (Patch *patch) |
| void | reset_counters () |
| void | reset_containers () |
| void | setNewGeneration (age_t AGE, Metapop *pop) |
| Fills the patch containers corresponding to the age flags passed, for both sexes. | |
| void | setNewGeneration (age_idx AGE, Metapop *pop) |
| Fills the patch container corresponding to the age class index passed, for both sexes. | |
| void | show_up () |
Setters | |
| void | setID (unsigned int i) |
| void | set_K (unsigned int k) |
| void | set_KFem (unsigned int k) |
| void | set_KMal (unsigned int k) |
| void | set_isExtinct (bool status) |
| void | set_age (unsigned int a) |
Getters | |
| unsigned int | getID () |
| unsigned int | get_K () |
| unsigned int | get_K (sex_t SEX) |
| unsigned int | get_KFem () |
| unsigned int | get_KMal () |
| bool | get_isExtinct () |
| unsigned int | get_age () |
| bool | isEmpty () |
| unsigned int | getAdultsNumber () |
| double | getPatchOffsprgSatLevel () |
| double | getPatchAdultsSatLevel () |
Public Attributes | |
| unsigned short | nbEmigrant |
| unsigned short | nbImigrant |
| unsigned short | nbPhilopat |
| short | nbKolonisers |
Private Attributes | |
| unsigned int | _ID |
| Patch ID is equal to its position in the metapop patch array. | |
| unsigned int | _K |
| Carrying capacity for males and females. | |
| unsigned int | _KFem |
| Sex specific carrying capacity. | |
| unsigned int | _KMal |
| bool | _isExtinct |
| Extinction flag. | |
| unsigned int | _age |
| age since last extinction. | |
| unsigned int | _nb_age_class |
| Number of age classes present. | |
| unsigned int | _sizes [2][3] |
| Containers size counters, sex X age. | |
| unsigned int | _capacities [2][3] |
| Total size of the containers, amount of allocated memory. | |
| deque< Individual * > | _containers [2][3] |
| Individuals containers, sex X age. | |
Second class in the metapopulation design structure, between the Metapop and Individual classes.
The Patch class is an abstraction of a sub-population or patch concept (also called a deme) in a metapopulation context. It contains the individual containers for the different age classes. Three main age classes are currently implemented, the offspring, post-dispersal and adult classes (see the age_t enum) which are all subdivided into male and female individuals. These containers are accessed using the interface defined here or through the Metapop class interface. The different LCEs will use these interfaces to handle the individuals. They are also responsible to change the age flag of the population (see Metapop).
The individuals are accessed using their age index value and not the age flag value (e.g., using the Patch::get() method). These indexes are defined in the age_idx enum (see type.h) and differ from the age class flag values. For instance the adults' containers have the index 2 (ADLTx = 2) whereas their age flag is 4 (ADULTS = 4). This might be confusing but it saves a lot of checks at runtime! It also allows to give a flag containing several class bits set instead of a unique index value when needed (see the Patch::size() and Metapop::size() suite of functions).
| Patch::Patch | ( | ) | [inline] |
Definition at line 415 of file metapop.h.
References _capacities, _nb_age_class, _sizes, FEM, and MAL.
: _ID(0), _K(1), _KFem(1), _KMal(1), _isExtinct(0), _age(0), _nb_age_class(3) { for(unsigned int i = 0; i < _nb_age_class; i++) { _sizes[MAL][i] = 0; _sizes[FEM][i] = 0; _capacities[MAL][i] = 0; _capacities[FEM][i] = 0;} }
| Patch::~Patch | ( | ) |
Definition at line 120 of file patch.cc.
{
//#ifdef _DEBUG_
// message("Patch::~Patch\n");
//#endif
for (unsigned int i = 0; i < 2; ++i)
for(unsigned int j = 0; j < _nb_age_class; ++j)
for(unsigned int k = 0; k < _sizes[i][j] ; ++k)
delete _containers[i][j][k];
}
| void Patch::add | ( | sex_t | SEX, |
| age_idx | AGE, | ||
| Individual * | ind | ||
| ) | [inline] |
Adds an individual to the appropriate container, increments its size, eventually resizing it.
| SEX | the sex class of the individual |
| AGE | the index of the age class |
| ind | the pointer to the individual |
Definition at line 504 of file metapop.h.
References _capacities, _containers, _K, and _sizes.
Referenced by copy2patch(), LCE_Breed_Selection_Disperse::do_breed(), LCE_Breed_Disperse::do_breed_disperse(), LCE_Breed_Selection::execute(), LCE_Breed::execute(), TTNeutralGenesFH::FHread(), TTDeletMutBitstrFH::FHread(), Metapop::fillPatchFromSource(), LCE_Resize::fillPatchNoBackup(), LCE_Resize::fillPatchWithBackup(), move(), LCE_Resize::regulateAgeClassWithBackup(), LCE_Breed_Wolbachia::wolbachia_model_1(), and LCE_Breed_Wolbachia::wolbachia_model_2().
{
if( _sizes[SEX][AGE] + 1 > _capacities[SEX][AGE] ) {
_containers[SEX][AGE].resize( _capacities[SEX][AGE] + _K );
_capacities[SEX][AGE] += _K;
}
_containers[SEX][AGE][ _sizes[SEX][AGE]++ ] = ind;
}
Assigns a new container of given size for the sex and age class passed, sets all values to NULL.
Definition at line 516 of file metapop.h.
References _capacities, _containers, and _sizes.
{ _containers[SEX][AGE].assign(n,0);
_sizes[SEX][AGE] = 0;
_capacities[SEX][AGE] = n;
}
Sets the size of the appropriate container to zero.
Note: no memory operation is performed, the capacity of the container is thus not affected. The individual pointers are not flushed to the recycling pool, they will be overwritten by subsequent operations. It is thus a good idea to consider using Patch::flush to be shure no pointers remained in the container.
| SEX | the sex class |
| AGE | the index of the age class |
Definition at line 587 of file metapop.h.
References _sizes.
Referenced by LCE_Resize::buildNewPatchArrayWithBackup(), LCE_Resize::execute(), and LCE_Resize::removeDesignatedPatch().
{ _sizes[SEX][AGE] = 0;}
| void Patch::clear | ( | ) | [inline] |
| void Patch::copy2patch | ( | sex_t | from_sex, |
| sex_t | to_sex, | ||
| age_idx | from_age, | ||
| age_idx | to_age, | ||
| Patch * | to_patch | ||
| ) | [inline] |
Definition at line 644 of file metapop.h.
References _containers, _sizes, and add().
Referenced by LCE_Resize::buildNewPatchArrayWithBackup(), copy2patch(), and LCE_Resize::removeDesignatedPatch().
{
for (unsigned int i = 0; i < _sizes[from_sex][from_age]; ++i)
to_patch->add(to_sex, to_age, _containers[from_sex][from_age][i] );
}
Definition at line 656 of file metapop.h.
References copy2patch(), FEM, and MAL.
{
copy2patch(FEM, AGE, patch);
copy2patch(MAL, AGE, patch);
}
| void Patch::copy2patch | ( | Patch * | patch | ) | [inline] |
Definition at line 662 of file metapop.h.
References _nb_age_class, copy2patch(), FEM, and MAL.
{
for (unsigned int i = 0; i < _nb_age_class; ++i){
copy2patch(FEM, static_cast<age_idx> (i), patch);
copy2patch(MAL, static_cast<age_idx> (i), patch);
}
}
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. Note: not memory operation is performed, the total amount of memory allocated is left untouched.
| SEX | the sex class of the individual |
| AGE | the index of the age class |
| pop | the pointer to the metapop for access to the recycling pool |
Definition at line 598 of file metapop.h.
References _containers, _sizes, and IndFactory::recycle().
Referenced by LCE_Breed_Selection_Disperse::breed_selection_disperse(), LCE_Breed_base::checkCloning(), LCE_Breed_base::checkSelfing(), LCE_Breed_Disperse::do_breed_disperse(), flush(), and LCE_Disperse_base::reset_counters().
{
for (unsigned int i = 0; i < _sizes[SEX][AGE]; ++i) {
pop->recycle(_containers[SEX][AGE][i]);
_containers[SEX][AGE][i] = 0;
}
_sizes[SEX][AGE] = 0;
}
Removes all individual pointers of the appropriate sex and age class and flush them into the recycling pool.
| AGE | an unsigned int containing the flags of the age classes to flush |
| pop | the pointer to the metapop for access to the recycling pool |
Definition at line 615 of file metapop.h.
References _nb_age_class, FEM, flush(), and MAL.
{
unsigned int mask = 1;
for(unsigned int i = 0; i < _nb_age_class; i++) {
if( (mask & AGE) != 0) {
flush(MAL, static_cast<age_idx>(i), pop);
flush(FEM, static_cast<age_idx>(i), pop);
}
mask <<= 1;
}
}
| void Patch::flush | ( | Metapop * | pop | ) | [inline] |
Removes all individual pointers of all sex and age classes and flush them into the recycling pool.
Definition at line 629 of file metapop.h.
References _nb_age_class, FEM, flush(), and MAL.
{
for(unsigned int i = 0; i < _nb_age_class; i++) {
flush(MAL, static_cast<age_idx>(i), pop);
flush(FEM, static_cast<age_idx>(i), pop);
}
}
| Individual* Patch::get | ( | sex_t | SEX, |
| age_idx | AGE, | ||
| unsigned int | at | ||
| ) | [inline] |
Returns a pointer to the individual sitting at the index passed.
Note: the get operations are unchecked! It's up to the user to check for overflows.
| SEX | the sex class of the individual |
| AGE | the index of the age class |
| at | the index of the individual in the container |
Definition at line 487 of file metapop.h.
References _containers.
Referenced by LCE_Selection_base::doViabilitySelection(), LCE_Disperse_EvolDisp::evoldisp(), LCE_Breed_Selection::execute(), LCE_Breed::execute(), TTDeletMutBitstrFH::FHwrite(), Metapop::fillPatchFromSource(), LCE_Resize::fillPatchWithBackup(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Breed_base::fullMonoginy(), LCE_Breed_base::fullPolyginy(), LCE_Breed_base::fullPolyginy_manyMales(), Metapop::get(), LCE_Breed_Disperse::get_parent(), TTWolbachiaSH::getMeanFemaleInfection_perPatch(), LCE_Selection_base::getMeanFitness(), TTWolbachiaSH::getMeanMaleInfection_perPatch(), TTWolbachiaSH::getMeanOffsprgFemaleInfection_perPatch(), TTWolbachiaSH::getMeanOffsprgInfection(), TTWolbachiaSH::getMeanOffsprgMaleInfection_perPatch(), LCE_Selection_base::getMeanPatchFitness(), LCE_SelectionSH::getPatchFitness(), LCE_Breed_Wolbachia::hasInfectedFemale(), LCE_Breed_Wolbachia::inoculate_wolbachia(), LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder(), LCE_Breed_base::partialMonoginy(), LCE_Breed_base::partialSelfing(), LCE_Breed_base::random_hermaphrodite(), LCE_Breed_base::RandomMating(), LCE_Resize::regulateAgeClassNoBackup(), LCE_Resize::regulateAgeClassWithBackup(), TTWolbachiaSH::setInfectionStats(), LCE_Breed_Wolbachia::wolbachia_model_1(), LCE_Breed_Wolbachia::wolbachia_model_2(), TTNeutralGenesFH::write_FSTAT(), and TTNeutralGenesFH::write_varcompWC().
{ return _containers[SEX][AGE][at]; }
| unsigned int Patch::get_age | ( | ) | [inline] |
| bool Patch::get_isExtinct | ( | ) | [inline] |
Definition at line 440 of file metapop.h.
References _isExtinct.
Referenced by LCE_Disperse_EvolDisp::execute(), LCE_Breed_Wolbachia::inoculate_wolbachia(), LCE_Disperse_ConstDisp::Migrate(), LCE_Breed_Disperse::numFemOffspring_colonizers(), and LCE_Breed_Disperse::numMalOffspring_random_colonizers().
{return _isExtinct;}
| unsigned int Patch::get_K | ( | ) | [inline] |
| unsigned int Patch::get_K | ( | sex_t | SEX | ) | [inline] |
| unsigned int Patch::get_KFem | ( | ) | [inline] |
Definition at line 438 of file metapop.h.
References _KFem.
Referenced by LCE_Resize::fillPatchNoBackup(), LCE_Resize::fillPatchWithBackup(), LCE_Breed_Disperse::numFemOffspring(), LCE_Breed_Disperse::numFemOffspring_colonizers(), LCE_Resize::regulateAgeClassNoBackup(), and LCE_Resize::regulateAgeClassWithBackup().
{return _KFem;}
| unsigned int Patch::get_KMal | ( | ) | [inline] |
Definition at line 439 of file metapop.h.
References _KMal.
Referenced by LCE_Resize::fillPatchNoBackup(), LCE_Resize::fillPatchWithBackup(), LCE_Breed_Disperse::numMalOffspring_random(), LCE_Breed_Disperse::numMalOffspring_random_colonizers(), LCE_Resize::regulateAgeClassNoBackup(), and LCE_Resize::regulateAgeClassWithBackup().
{return _KMal;}
| unsigned int Patch::getAdultsNumber | ( | ) | [inline] |
| void Patch::getCopy | ( | sex_t | SEX, |
| age_idx | AGE, | ||
| deque< Individual * > & | to | ||
| ) | [inline] |
Definition at line 637 of file metapop.h.
References _containers, and _sizes.
{
for (unsigned int i = 0; i < _sizes[SEX][AGE]; ++i) {
to.push_back(_containers[SEX][AGE][i]);
}
}
| unsigned int Patch::getID | ( | ) | [inline] |
Definition at line 435 of file metapop.h.
References _ID.
Referenced by LCE_Resize::fillPatchNoBackup(), and LCE_Resize::removeDesignatedPatch().
{return _ID;}
| double Patch::getPatchAdultsSatLevel | ( | ) | [inline] |
| double Patch::getPatchOffsprgSatLevel | ( | ) | [inline] |
| Patch * Patch::init | ( | unsigned int | nbfem, |
| unsigned int | nbmal, | ||
| unsigned int | id | ||
| ) |
Definition at line 38 of file patch.cc.
Referenced by LCE_Resize::execute().
{
_ID = id;
_KFem = nbfem;
_KMal = nbmal;
_K = _KFem + _KMal;
_isExtinct = false;
_age = 0;
reset_counters();
reset_containers();
return this;
}
| bool Patch::isEmpty | ( | ) | [inline] |
Moves an individual from an age class to an other one.
Note: both containers are transformed by this operation. The 'from' container size is reduced by one while the 'to' container size is increased by one.
| SEX | the sex class of the individual |
| from | the original age class of the individual |
| to | the destination age class of the individual |
| at | the index of the individual in the container |
Definition at line 551 of file metapop.h.
References _containers, and add().
Referenced by LCE_Disperse_EvolDisp::evoldisp(), and LCE_Disperse_EvolDisp::fixdisp().
{
add( SEX, to, _containers[SEX][from][at] );
remove( SEX, from, at );
}
| Individual* Patch::remove | ( | sex_t | SEX, |
| age_idx | AGE, | ||
| unsigned int | at | ||
| ) | [inline] |
Removes the individual sitting at the given index in the appropriate container.
| SEX | the sex class of the individual |
| AGE | the index of the age class |
| at | the index of the individual in the container |
Definition at line 528 of file metapop.h.
References _containers, _sizes, and error().
Referenced by LCE_Selection_base::doViabilitySelection(), LCE_Disperse_EvolDisp::evoldisp(), LCE_Resize::fillPatchWithBackup(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder(), LCE_Resize::regulateAgeClassNoBackup(), and LCE_Resize::regulateAgeClassWithBackup().
{
if(_sizes[SEX][AGE] == 0) {
error("Patch::remove:: container already empty!!");
return NULL;
}
unsigned int last = _sizes[SEX][AGE] - 1;
Individual* ind = _containers[SEX][AGE][at];
_containers[SEX][AGE][at] = _containers[SEX][AGE][ last ];
_containers[SEX][AGE][ last ] = 0;
_sizes[SEX][AGE]--;
return ind;
}
| void Patch::reset_containers | ( | ) |
Definition at line 66 of file patch.cc.
{
for(unsigned int i=0; i < _nb_age_class; i++) {
_containers[MAL][i].assign( _KMal, 0 );
_containers[FEM][i].assign( _KFem, 0 );
_sizes[MAL][i] = 0;
_sizes[FEM][i] = 0;
_capacities[MAL][i] = _KMal;
_capacities[FEM][i] = _KFem;
}
}
| void Patch::reset_counters | ( | ) |
Definition at line 56 of file patch.cc.
Referenced by LCE_Disperse_base::reset_counters().
{
nbEmigrant = 0;
nbImigrant = 0;
nbPhilopat = 0;
nbKolonisers = 0;
}
| void Patch::set | ( | sex_t | SEX, |
| age_idx | AGE, | ||
| unsigned int | at, | ||
| Individual * | ind | ||
| ) | [inline] |
Modifies the appropriate container with value of the pointer given.
| SEX | the sex class of the individual |
| AGE | the index of the age class |
| at | the index of the individual in the container |
| ind | the pointer to the individual |
Definition at line 496 of file metapop.h.
References _containers.
{ _containers[SEX][AGE][at] = ind; }
| void Patch::set_age | ( | unsigned int | a | ) | [inline] |
| void Patch::set_isExtinct | ( | bool | status | ) | [inline] |
| void Patch::set_K | ( | unsigned int | k | ) | [inline] |
| void Patch::set_KFem | ( | unsigned int | k | ) | [inline] |
Definition at line 428 of file metapop.h.
References _KFem.
Referenced by LCE_Resize::updatePatchCapacities().
{_KFem = k;}
| void Patch::set_KMal | ( | unsigned int | k | ) | [inline] |
Definition at line 429 of file metapop.h.
References _KMal.
Referenced by LCE_Resize::updatePatchCapacities().
{_KMal = k;}
| void Patch::setID | ( | unsigned int | i | ) | [inline] |
Fills the patch containers corresponding to the age flags passed, for both sexes.
Definition at line 80 of file patch.cc.
{
unsigned int mask = 1;
for(unsigned int i = 0; i < _nb_age_class; i++) {
if( (mask & AGE) != 0) setNewGeneration(static_cast<age_idx>(i), pop);
mask<<=1;
}
}
Fills the patch container corresponding to the age class index passed, for both sexes.
Definition at line 92 of file patch.cc.
References Individual::create_first_gen(), FEM, IndFactory::makeNewIndividual(), and MAL.
{
Individual *new_ind;
//--------------------------------------------------------------------
//if too much females in the Patch, flush them into the RecyclingPOOL
if(size(FEM, AGE) > 0) flush(FEM, AGE, pop);
for(unsigned int i = 0; i < _KFem; i++) {
new_ind = pop->makeNewIndividual(0,0,FEM,_ID);
new_ind->create_first_gen();
add(FEM, AGE, new_ind);
}
//--------------------------------------------------------------------
//males: same as for the females....
if(size(MAL, AGE) > 0) flush(MAL, AGE, pop);
for(unsigned int i = 0; i < _KMal; i++) {
new_ind = pop->makeNewIndividual(0,0,MAL,_ID);
new_ind->create_first_gen();
add(MAL, AGE, new_ind);
}
}
| unsigned int Patch::size | ( | age_t | AGE | ) | [inline] |
Returns the size of the container of the appropriate age class(es) for both sexes.
| AGE | the flag value of the age class |
Definition at line 451 of file metapop.h.
References FEM, MAL, and size().
Referenced by LCE_Breed_Selection_Disperse::breed_selection_disperse(), LCE_Breed_base::checkCloning(), LCE_Breed_base::checkNoSelfing(), LCE_Breed_base::checkPolygyny(), LCE_Breed_base::checkSelfing(), LCE_Breed_Disperse::do_breed_disperse(), LCE_Selection_base::doViabilitySelection(), LCE_Disperse_EvolDisp::evoldisp(), LCE_Breed_Selection::execute(), LCE_Disperse_EvolDisp::execute(), LCE_Breed::execute(), TTDeletMutBitstrFH::FHwrite(), Metapop::fillPatchFromSource(), LCE_Resize::fillPatchNoBackup(), LCE_Resize::fillPatchWithBackup(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Breed_base::fullMonoginy(), LCE_Breed_base::fullPolyginy_manyMales(), LCE_Breed_Disperse::get_parent(), getAdultsNumber(), TTWolbachiaSH::getMeanFemaleInfection_perPatch(), LCE_Selection_base::getMeanFitness(), TTWolbachiaSH::getMeanMaleInfection_perPatch(), TTWolbachiaSH::getMeanOffsprgFemaleInfection_perPatch(), TTWolbachiaSH::getMeanOffsprgInfection(), TTWolbachiaSH::getMeanOffsprgMaleInfection_perPatch(), LCE_Selection_base::getMeanPatchFitness(), getPatchAdultsSatLevel(), LCE_SelectionSH::getPatchFitness(), getPatchOffsprgSatLevel(), LCE_Breed_Wolbachia::hasInfectedFemale(), LCE_Breed_Wolbachia::inoculate_wolbachia(), isEmpty(), LCE_Breed_Disperse::mate_selfing(), LCE_Disperse_ConstDisp::Migrate(), LCE_Disperse_ConstDisp::MigratePatch(), LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder(), LCE_Breed_base::partialMonoginy(), LCE_Breed_base::partialSelfing(), LCE_Breed_base::random_hermaphrodite(), LCE_Breed_base::RandomMating(), LCE_Resize::regulateAgeClassNoBackup(), LCE_Resize::regulateAgeClassWithBackup(), TTWolbachiaSH::setInfectionStats(), Metapop::size(), size(), LCE_Breed_Wolbachia::wolbachia_model_1(), LCE_Breed_Wolbachia::wolbachia_model_2(), TTNeutralGenesFH::write_FSTAT(), and TTNeutralGenesFH::write_varcompWC().
Returns the size of the container for the appropriate sex and age classes present in the age flag.
| SEX | the sex class |
| AGE | the flag value of the age class |
Definition at line 458 of file metapop.h.
References _nb_age_class, and _sizes.
{
unsigned int mask = 1, s = 0;
for(unsigned int i = 0; i < _nb_age_class; i++) {
if( (mask & AGE) != 0) s += _sizes[SEX][i];
mask <<= 1;
}
return s;
}
| unsigned int Patch::size | ( | age_idx | AGE | ) | [inline] |
Copies all elements in the 'from' age-class container to the 'to' age-class container of the same sex.
The previous elements of the 'to' container are overwritten, it is thus worth considering using flush() before swaping to avoid memory leaks! The size of the 'from' container is set to 0.
| SEX | the sex class of the individual |
| from | the original age class of the individual |
| to | the destination age class of the individual |
Definition at line 564 of file metapop.h.
References _capacities, _containers, _sizes, and clear().
Referenced by LCE_Disperse_base::swapPostDisp().
{
if( _sizes[SEX][from] > _capacities[SEX][to] ) {
_containers[SEX][to].resize( _sizes[SEX][from] );
_capacities[SEX][to] = _sizes[SEX][from];
}
for(unsigned int i = 0; i < _sizes[SEX][from]; ++i)
_containers[SEX][to][i] = _containers[SEX][from][i];
_sizes[SEX][to] = _sizes[SEX][from];
clear(SEX, from);
}
unsigned int Patch::_age [private] |
unsigned int Patch::_capacities[2][3] [private] |
deque<Individual*> Patch::_containers[2][3] [private] |
unsigned int Patch::_ID [private] |
bool Patch::_isExtinct [private] |
Extinction flag.
Definition at line 397 of file metapop.h.
Referenced by get_isExtinct(), and set_isExtinct().
unsigned int Patch::_K [private] |
Carrying capacity for males and females.
Definition at line 393 of file metapop.h.
Referenced by add(), get_K(), getPatchAdultsSatLevel(), getPatchOffsprgSatLevel(), and set_K().
unsigned int Patch::_KFem [private] |
Sex specific carrying capacity.
Definition at line 395 of file metapop.h.
Referenced by get_K(), get_KFem(), and set_KFem().
unsigned int Patch::_KMal [private] |
Definition at line 395 of file metapop.h.
Referenced by get_K(), get_KMal(), and set_KMal().
unsigned int Patch::_nb_age_class [private] |
unsigned int Patch::_sizes[2][3] [private] |
| unsigned short Patch::nbEmigrant |
Definition at line 411 of file metapop.h.
Referenced by LCE_Disperse_EvolDisp::evoldisp(), LCE_Breed_Disperse::execute(), LCE_Disperse_ConstDisp::execute(), LCE_Breed_Selection_Disperse::execute(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Breed_Disperse::get_parent(), LCE_Disperse_ConstDisp::MigratePatch(), and LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder().
| unsigned short Patch::nbImigrant |
Definition at line 411 of file metapop.h.
Referenced by LCE_Disperse_EvolDisp::evoldisp(), LCE_Breed_Disperse::execute(), LCE_Breed_Selection_Disperse::execute(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Breed_Disperse::get_parent(), LCE_Disperse_ConstDisp::MigratePatch(), and LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder().
| short Patch::nbKolonisers |
Definition at line 412 of file metapop.h.
Referenced by LCE_Disperse_EvolDisp::execute(), LCE_Breed_Disperse::get_parent(), and LCE_Disperse_ConstDisp::Migrate().
| unsigned short Patch::nbPhilopat |
Definition at line 411 of file metapop.h.
Referenced by LCE_Disperse_EvolDisp::evoldisp(), LCE_Breed_Disperse::execute(), LCE_Breed_Selection_Disperse::execute(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Breed_Disperse::get_parent(), LCE_Disperse_ConstDisp::MigratePatch(), and LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder().
1.7.5.1 -- Nemo is hosted by