#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. | |
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).
Definition at line 388 of file metapop.h.
| Patch::Patch | ( | ) | [inline] |
Definition at line 415 of file metapop.h.
00415 : _ID(0), _K(1), _KFem(1), _KMal(1), _isExtinct(0), _age(0), _nb_age_class(3) 00416 { for(unsigned int i = 0; i < _nb_age_class; i++) { 00417 _sizes[MAL][i] = 0; 00418 _sizes[FEM][i] = 0; 00419 _capacities[MAL][i] = 0; 00420 _capacities[FEM][i] = 0;} 00421 }
| Patch::~Patch | ( | ) |
Definition at line 120 of file patch.cc.
00121 { 00122 //#ifdef _DEBUG_ 00123 // message("Patch::~Patch\n"); 00124 //#endif 00125 00126 for (unsigned int i = 0; i < 2; ++i) 00127 for(unsigned int j = 0; j < _nb_age_class; ++j) 00128 for(unsigned int k = 0; k < _sizes[i][j] ; ++k) 00129 delete _containers[i][j][k]; 00130 }
| 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.
Referenced by copy2patch(), LCE_Breed_Selection_Disperse::do_breed(), LCE_Breed_Disperse::do_breed_disperse(), LCE_Cross::execute(), LCE_Breed_Selection::execute(), LCE_Breed_Wolbachia::execute(), LCE_Breed::execute(), TTNeutralGenesFH::FHread(), TTDeletMutBitstrFH::FHread(), Metapop::fillPatchFromSource(), LCE_Resize::fillPatchNoBackup(), LCE_Resize::fillPatchWithBackup(), and LCE_Resize::regulateAgeClassWithBackup().
00505 { 00506 00507 if( _sizes[SEX][AGE] + 1 > _capacities[SEX][AGE] ) { 00508 _containers[SEX][AGE].resize( _capacities[SEX][AGE] + _K ); 00509 _capacities[SEX][AGE] += _K; 00510 } 00511 00512 _containers[SEX][AGE][ _sizes[SEX][AGE]++ ] = ind; 00513 }
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.
00517 { _containers[SEX][AGE].assign(n,0); 00518 _sizes[SEX][AGE] = 0; 00519 _capacities[SEX][AGE] = n; 00520 }
| void Patch::clear | ( | ) | [inline] |
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.
Referenced by LCE_Resize::buildNewPatchArrayWithBackup(), LCE_Resize::execute(), and LCE_Resize::removeDesignatedPatch().
00587 { _sizes[SEX][AGE] = 0;}
| void Patch::copy2patch | ( | Patch * | patch | ) | [inline] |
Definition at line 662 of file metapop.h.
00663 { 00664 for (unsigned int i = 0; i < _nb_age_class; ++i){ 00665 copy2patch(FEM, static_cast<age_idx> (i), patch); 00666 copy2patch(MAL, static_cast<age_idx> (i), patch); 00667 } 00668 }
Definition at line 656 of file metapop.h.
00657 { 00658 copy2patch(FEM, AGE, patch); 00659 copy2patch(MAL, AGE, patch); 00660 }
| 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.
Referenced by LCE_Resize::buildNewPatchArrayWithBackup(), copy2patch(), and LCE_Resize::removeDesignatedPatch().
00645 { 00646 for (unsigned int i = 0; i < _sizes[from_sex][from_age]; ++i) 00647 to_patch->add(to_sex, to_age, _containers[from_sex][from_age][i] ); 00648 }
| 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.
00630 { 00631 for(unsigned int i = 0; i < _nb_age_class; i++) { 00632 flush(MAL, static_cast<age_idx>(i), pop); 00633 flush(FEM, static_cast<age_idx>(i), pop); 00634 } 00635 }
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.
00616 { 00617 unsigned int mask = 1; 00618 00619 for(unsigned int i = 0; i < _nb_age_class; i++) { 00620 if( (mask & AGE) != 0) { 00621 flush(MAL, static_cast<age_idx>(i), pop); 00622 flush(FEM, static_cast<age_idx>(i), pop); 00623 } 00624 mask <<= 1; 00625 } 00626 }
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.
Referenced by LCE_Breed_Selection_Disperse::breed_selection_disperse(), LCE_Breed_base::checkCloning(), LCE_Breed_base::checkSelfing(), LCE_Breed_Disperse::do_breed_disperse(), LCE_Patch_Extinction::do_flush(), LCE_Aging::execute(), flush(), LCE_Disperse_base::reset_counters(), and setNewGeneration().
00599 { 00600 for (unsigned int i = 0; i < _sizes[SEX][AGE]; ++i) { 00601 pop->recycle(_containers[SEX][AGE][i]); 00602 _containers[SEX][AGE][i] = 0; 00603 } 00604 _sizes[SEX][AGE] = 0; 00605 }
| 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.
Referenced by LCE_Selection_base::doViabilitySelection(), LCE_Disperse_EvolDisp::evoldisp(), LCE_Breed_Selection::execute(), LCE_Breed_Wolbachia::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(), TTNeutralGenesFH::write_FSTAT(), and TTNeutralGenesFH::write_varcompWC().
00488 { return _containers[SEX][AGE][at]; }
| unsigned int Patch::get_age | ( | ) | [inline] |
| bool Patch::get_isExtinct | ( | ) | [inline] |
Definition at line 440 of file metapop.h.
Referenced by LCE_Patch_Extinction::execute(), 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().
00440 {return _isExtinct;}
| unsigned int Patch::get_K | ( | sex_t | SEX | ) | [inline] |
| unsigned int Patch::get_K | ( | ) | [inline] |
Definition at line 436 of file metapop.h.
Referenced by LCE_Patch_Extinction::execute(), and LCE_Regulation::regulatePatch().
00436 {return _K;}
| unsigned int Patch::get_KFem | ( | ) | [inline] |
Definition at line 438 of file metapop.h.
Referenced by LCE_Aging::execute(), LCE_Resize::fillPatchNoBackup(), LCE_Resize::fillPatchWithBackup(), LCE_Breed_Disperse::numFemOffspring(), LCE_Breed_Disperse::numFemOffspring_colonizers(), LCE_Resize::regulateAgeClassNoBackup(), and LCE_Resize::regulateAgeClassWithBackup().
00438 {return _KFem;}
| unsigned int Patch::get_KMal | ( | ) | [inline] |
Definition at line 439 of file metapop.h.
Referenced by LCE_Aging::execute(), LCE_Resize::fillPatchNoBackup(), LCE_Resize::fillPatchWithBackup(), LCE_Breed_Disperse::numMalOffspring_random(), LCE_Breed_Disperse::numMalOffspring_random_colonizers(), LCE_Resize::regulateAgeClassNoBackup(), and LCE_Resize::regulateAgeClassWithBackup().
00439 {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.
Referenced by LCE_Cross::execute().
00638 { 00639 for (unsigned int i = 0; i < _sizes[SEX][AGE]; ++i) { 00640 to.push_back(_containers[SEX][AGE][i]); 00641 } 00642 }
| unsigned int Patch::getID | ( | ) | [inline] |
Definition at line 435 of file metapop.h.
Referenced by LCE_Patch_Extinction::do_remove(), LCE_Resize::fillPatchNoBackup(), LCE_Patch_Extinction::get_harvest_size(), and LCE_Resize::removeDesignatedPatch().
00435 {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().
00039 { 00040 _ID = id; 00041 _KFem = nbfem; 00042 _KMal = nbmal; 00043 _K = _KFem + _KMal; 00044 _isExtinct = false; 00045 _age = 0; 00046 00047 reset_counters(); 00048 00049 reset_containers(); 00050 00051 return this; 00052 }
| 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.
Referenced by LCE_Disperse_EvolDisp::evoldisp(), LCE_Aging::execute(), and LCE_Disperse_EvolDisp::fixdisp().
00552 { 00553 add( SEX, to, _containers[SEX][from][at] ); 00554 remove( SEX, from, at ); 00555 }
| 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.
Referenced by LCE_Patch_Extinction::do_remove(), LCE_Selection_base::doViabilitySelection(), LCE_Disperse_EvolDisp::evoldisp(), LCE_Resize::fillPatchWithBackup(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder(), LCE_Resize::regulateAgeClassNoBackup(), LCE_Resize::regulateAgeClassWithBackup(), and LCE_Regulation::regulatePatch().
00529 { 00530 if(_sizes[SEX][AGE] == 0) { 00531 error("Patch::remove:: container already empty!!"); 00532 return NULL; 00533 } 00534 unsigned int last = _sizes[SEX][AGE] - 1; 00535 Individual* ind = _containers[SEX][AGE][at]; 00536 _containers[SEX][AGE][at] = _containers[SEX][AGE][ last ]; 00537 _containers[SEX][AGE][ last ] = 0; 00538 _sizes[SEX][AGE]--; 00539 return ind; 00540 }
| void Patch::reset_containers | ( | ) |
Definition at line 66 of file patch.cc.
Referenced by init().
00067 { 00068 for(unsigned int i=0; i < _nb_age_class; i++) { 00069 _containers[MAL][i].assign( _KMal, 0 ); 00070 _containers[FEM][i].assign( _KFem, 0 ); 00071 _sizes[MAL][i] = 0; 00072 _sizes[FEM][i] = 0; 00073 _capacities[MAL][i] = _KMal; 00074 _capacities[FEM][i] = _KFem; 00075 } 00076 }
| void Patch::reset_counters | ( | ) |
Definition at line 56 of file patch.cc.
Referenced by init(), and LCE_Disperse_base::reset_counters().
00057 { 00058 nbEmigrant = 0; 00059 nbImigrant = 0; 00060 nbPhilopat = 0; 00061 nbKolonisers = 0; 00062 }
| 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.
00497 { _containers[SEX][AGE][at] = ind; }
| void Patch::set_age | ( | unsigned int | a | ) | [inline] |
Definition at line 431 of file metapop.h.
Referenced by LCE_Patch_Extinction::do_flush(), and LCE_Aging::execute().
00431 {_age = a;}
| void Patch::set_isExtinct | ( | bool | status | ) | [inline] |
Definition at line 430 of file metapop.h.
Referenced by LCE_Patch_Extinction::do_flush(), and LCE_Aging::execute().
00430 {_isExtinct = status;}
| void Patch::set_K | ( | unsigned int | k | ) | [inline] |
| void Patch::set_KFem | ( | unsigned int | k | ) | [inline] |
Definition at line 428 of file metapop.h.
Referenced by LCE_Resize::updatePatchCapacities().
00428 {_KFem = k;}
| void Patch::set_KMal | ( | unsigned int | k | ) | [inline] |
Definition at line 429 of file metapop.h.
Referenced by LCE_Resize::updatePatchCapacities().
00429 {_KMal = k;}
| void Patch::setID | ( | unsigned int | i | ) | [inline] |
Fills the patch container corresponding to the age class index passed, for both sexes.
Definition at line 92 of file patch.cc.
00093 { 00094 Individual *new_ind; 00095 00096 //-------------------------------------------------------------------- 00097 //if too much females in the Patch, flush them into the RecyclingPOOL 00098 if(size(FEM, AGE) > 0) flush(FEM, AGE, pop); 00099 00100 for(unsigned int i = 0; i < _KFem; i++) { 00101 new_ind = pop->makeNewIndividual(0,0,FEM,_ID); 00102 new_ind->create_first_gen(); 00103 add(FEM, AGE, new_ind); 00104 } 00105 00106 //-------------------------------------------------------------------- 00107 //males: same as for the females.... 00108 if(size(MAL, AGE) > 0) flush(MAL, AGE, pop); 00109 00110 for(unsigned int i = 0; i < _KMal; i++) { 00111 new_ind = pop->makeNewIndividual(0,0,MAL,_ID); 00112 new_ind->create_first_gen(); 00113 add(MAL, AGE, new_ind); 00114 } 00115 00116 }
Fills the patch containers corresponding to the age flags passed, for both sexes.
Definition at line 80 of file patch.cc.
00081 { 00082 unsigned int mask = 1; 00083 00084 for(unsigned int i = 0; i < _nb_age_class; i++) { 00085 if( (mask & AGE) != 0) setNewGeneration(static_cast<age_idx>(i), pop); 00086 mask<<=1; 00087 } 00088 }
| void Patch::show_up | ( | ) |
Definition at line 134 of file patch.cc.
00135 { 00136 message("Patch %i:\n age: %i; K: %i, K_fem: %i; K_mal: %i\n",_ID, _age, _K, _KFem, _KMal); 00137 for(unsigned int j = 0; j < _nb_age_class; ++j) 00138 message(" age class %i: females: %i; males: %i\n", j, _sizes[FEM][j], _sizes[MAL][j]); 00139 }
| unsigned int Patch::size | ( | age_idx | AGE | ) | [inline] |
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.
00459 { 00460 unsigned int mask = 1, s = 0; 00461 for(unsigned int i = 0; i < _nb_age_class; i++) { 00462 if( (mask & AGE) != 0) s += _sizes[SEX][i]; 00463 mask <<= 1; 00464 } 00465 return s; 00466 }
| 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.
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_Patch_Extinction::do_remove(), LCE_Selection_base::doViabilitySelection(), LCE_Disperse_EvolDisp::evoldisp(), LCE_Cross::execute(), LCE_Patch_Extinction::execute(), LCE_Aging::execute(), LCE_Disperse_EvolDisp::execute(), LCE_Breed_Selection::execute(), LCE_Breed_Wolbachia::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_Patch_Extinction::get_harvest_size(), 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(), LCE_Regulation::regulatePatch(), TTWolbachiaSH::setInfectionStats(), setNewGeneration(), Metapop::size(), size(), TTNeutralGenesFH::write_FSTAT(), and TTNeutralGenesFH::write_varcompWC().
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.
Referenced by LCE_Disperse_base::swapPostDisp().
00565 { 00566 if( _sizes[SEX][from] > _capacities[SEX][to] ) { 00567 _containers[SEX][to].resize( _sizes[SEX][from] ); 00568 _capacities[SEX][to] = _sizes[SEX][from]; 00569 } 00570 00571 for(unsigned int i = 0; i < _sizes[SEX][from]; ++i) 00572 _containers[SEX][to][i] = _containers[SEX][from][i]; 00573 00574 _sizes[SEX][to] = _sizes[SEX][from]; 00575 clear(SEX, from); 00576 }
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(), init(), 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(), init(), set_K(), and show_up().
unsigned int Patch::_KFem [private] |
Sex specific carrying capacity.
Definition at line 395 of file metapop.h.
Referenced by get_K(), get_KFem(), init(), reset_containers(), set_KFem(), setNewGeneration(), and show_up().
unsigned int Patch::_KMal [private] |
Definition at line 395 of file metapop.h.
Referenced by get_K(), get_KMal(), init(), reset_containers(), set_KMal(), setNewGeneration(), and show_up().
unsigned int Patch::_nb_age_class [private] |
Number of age classes present.
Definition at line 401 of file metapop.h.
Referenced by copy2patch(), flush(), Patch(), reset_containers(), setNewGeneration(), show_up(), size(), and ~Patch().
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_Disperse_ConstDisp::execute(), LCE_Breed_Selection_Disperse::execute(), LCE_Breed_Disperse::execute(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Breed_Disperse::get_parent(), LCE_Disperse_ConstDisp::MigratePatch(), LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder(), and reset_counters().
| unsigned short Patch::nbImigrant |
Definition at line 411 of file metapop.h.
Referenced by LCE_Disperse_EvolDisp::evoldisp(), LCE_Breed_Selection_Disperse::execute(), LCE_Breed_Disperse::execute(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Breed_Disperse::get_parent(), LCE_Disperse_ConstDisp::MigratePatch(), LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder(), and reset_counters().
| short Patch::nbKolonisers |
Definition at line 412 of file metapop.h.
Referenced by LCE_Disperse_EvolDisp::execute(), LCE_Breed_Disperse::get_parent(), LCE_Disperse_ConstDisp::Migrate(), and reset_counters().
| unsigned short Patch::nbPhilopat |
Definition at line 411 of file metapop.h.
Referenced by LCE_Disperse_EvolDisp::evoldisp(), LCE_Breed_Selection_Disperse::execute(), LCE_Breed_Disperse::execute(), LCE_Disperse_EvolDisp::fixdisp(), LCE_Breed_Disperse::get_parent(), LCE_Disperse_ConstDisp::MigratePatch(), LCE_Disperse_ConstDisp::MigratePatch_AbsorbingBorder(), and reset_counters().
1.5.8 -- Nemo is hosted by