StatHandler of the Wolbachia trait.
More...
#include <ttwolbachia.h>
|
| | TTWolbachiaSH (TProtoWolbachia *TT) |
| |
| virtual | ~TTWolbachiaSH () |
| |
| virtual bool | setStatRecorders (string &token) |
| |
| void | setInfectionStats () |
| |
| double | getMeanInfection (unsigned int sex) |
| |
| double | getMeanOffsprgInfection (unsigned int sex) |
| |
| double | getMeanFemaleInfection_perPatch (unsigned int patch) |
| |
| double | getMeanMaleInfection_perPatch (unsigned int patch) |
| |
| double | getMeanOffsprgFemaleInfection_perPatch (unsigned int patch) |
| |
| double | getMeanOffsprgMaleInfection_perPatch (unsigned int patch) |
| |
| double | getIcompatibleMatingFreq () |
| |
| double | getDemicInfectionVar () |
| |
| double | getDemicExtinctionRate () |
| |
Public Member Functions inherited from TraitStatHandler< TProtoWolbachia, TTWolbachiaSH > |
| | TraitStatHandler (TProtoWolbachia *trait_proto) |
| |
| virtual | ~TraitStatHandler () |
| |
Public Member Functions inherited from StatHandler< SH > |
| | StatHandler () |
| |
| virtual | ~StatHandler () |
| |
| virtual void | clear () |
| | Empties the _recorders list, they are destroyed in StatHandlerBase::reset(). More...
|
| |
| virtual StatRecorder< SH > * | add (std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(SH::*getStatNoArg)(void), double(SH::*getStatOneArg)(unsigned int), double(SH::*getStatTwoArg)(unsigned int, unsigned int), void(SH::*setStat)(void)) |
| | Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list. More...
|
| |
Public Member Functions inherited from StatHandlerBase |
| | StatHandlerBase () |
| |
| virtual | ~StatHandlerBase () |
| |
| virtual void | reset () |
| | Empties the _stats list and calls clear() (defined in the derived class). More...
|
| |
| Metapop * | get_pop_ptr () |
| |
| void | set_service (StatServices *srv) |
| |
| StatServices * | get_service () |
| |
| unsigned int | getOccurrence () |
| |
| unsigned int | getNumOccurrences () |
| |
| unsigned int | getCurrentOccurrence () |
| |
| unsigned int | getNbRecorders () |
| |
| std::list< StatRecBase * > & | getStats () |
| |
| virtual void | add (StatRecBase *rec) |
| |
| virtual void | init () |
| |
| virtual void | update () |
| | This function is left empty as the StatServices calls StatRecorder::setVal directly. More...
|
| |
Public Member Functions inherited from Handler |
| virtual | ~Handler () |
| |
StatHandler of the Wolbachia trait.
◆ TTWolbachiaSH()
double _Mmean
Definition: ttwolbachia.h:161
int _TTidx
Definition: ttwolbachia.h:160
double _extrate
Definition: ttwolbachia.h:161
double _Fmean
Definition: ttwolbachia.h:161
double _var
Definition: ttwolbachia.h:161
TProtoWolbachia * _trait
Definition: ttwolbachia.h:159
virtual int get_index()
Index getter.
Definition: ttrait.h:146
◆ ~TTWolbachiaSH()
| virtual TTWolbachiaSH::~TTWolbachiaSH |
( |
| ) |
|
|
inlinevirtual |
◆ getDemicExtinctionRate()
| double TTWolbachiaSH::getDemicExtinctionRate |
( |
| ) |
|
|
inline |
◆ getDemicInfectionVar()
| double TTWolbachiaSH::getDemicInfectionVar |
( |
| ) |
|
|
inline |
◆ getIcompatibleMatingFreq()
| double TTWolbachiaSH::getIcompatibleMatingFreq |
( |
| ) |
|
◆ getMeanFemaleInfection_perPatch()
| double TTWolbachiaSH::getMeanFemaleInfection_perPatch |
( |
unsigned int |
patch | ) |
|
133 double indNbr = 0, mean = 0;
137 for(
unsigned int j = 0; j < indNbr; ++j)
140 return (indNbr != 0 ? mean/indNbr : nanf(
"NULL"));
void * getTraitValue(IDX T)
Accessor to the value (phenotype) of a particular trait.
Definition: individual.h:271
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:432
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:498
Individual * get(sex_t SEX, age_idx AGE, unsigned int at)
Returns a pointer to the individual sitting at the index passed.
Definition: metapop.h:534
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
@ FEM
Definition: types.h:37
@ ADLTx
Definition: types.h:42
References StatHandlerBase::_pop, _TTidx, ADLTx, FEM, Patch::get(), Metapop::getPatch(), Individual::getTraitValue(), and Patch::size().
Referenced by setStatRecorders().
◆ getMeanInfection()
| double TTWolbachiaSH::getMeanInfection |
( |
unsigned int |
sex | ) |
|
|
inline |
◆ getMeanMaleInfection_perPatch()
| double TTWolbachiaSH::getMeanMaleInfection_perPatch |
( |
unsigned int |
patch | ) |
|
◆ getMeanOffsprgFemaleInfection_perPatch()
| double TTWolbachiaSH::getMeanOffsprgFemaleInfection_perPatch |
( |
unsigned int |
patch | ) |
|
◆ getMeanOffsprgInfection()
| double TTWolbachiaSH::getMeanOffsprgInfection |
( |
unsigned int |
sex | ) |
|
108 double indNbr = 0, mean = 0;
128 return (indNbr != 0 ? mean/indNbr : nanf(
"NULL"));
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
References StatHandlerBase::_pop, _TTidx, FEM, Patch::get(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getTraitValue(), MAL, OFFSPRG, OFFSx, Metapop::size(), and Patch::size().
Referenced by setStatRecorders().
◆ getMeanOffsprgMaleInfection_perPatch()
| double TTWolbachiaSH::getMeanOffsprgMaleInfection_perPatch |
( |
unsigned int |
patch | ) |
|
◆ setInfectionStats()
| void TTWolbachiaSH::setInfectionStats |
( |
| ) |
|
37 double Fsize = 0, Msize = 0, val, local_inf;
63 for(
unsigned int j = 0; j < fsize; ++j) {
69 all[i] = local_inf / fsize;
80 double local_mean = 0;
89 const long double delta = (all[i] - local_mean);
90 _var += (delta * delta -
_var) / (i + 1);
96 for(
unsigned int j = 0, msize = crnt_patch->
size(
MAL,
ADLTx); j < msize; ++j)
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
References _extrate, _Fmean, _Mmean, StatHandlerBase::_pop, _TTidx, _var, ADLTx, ADULTS, FEM, Patch::get(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getTraitValue(), MAL, Metapop::size(), and Patch::size().
Referenced by setStatRecorders().
◆ setStatRecorders()
| bool TTWolbachiaSH::setStatRecorders |
( |
string & |
token | ) |
|
|
virtual |
Implements StatHandlerBase.
118 if(token ==
"wolbachia") {
128 }
else if(token ==
"wolbachia_perpatch") {
130 ostringstream name, sub_name;
147 sub_name<<
"adlt.p"<<i+1<<
"fwoinf";
virtual StatRecorder< SH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(SH::*getStatNoArg)(void), double(SH::*getStatOneArg)(unsigned int), double(SH::*getStatTwoArg)(unsigned int, unsigned int), void(SH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
double getDemicExtinctionRate()
Definition: ttwolbachia.h:181
double getDemicInfectionVar()
Definition: ttwolbachia.h:180
double getMeanInfection(unsigned int sex)
Definition: ttwolbachia.h:173
double getMeanFemaleInfection_perPatch(unsigned int patch)
Definition: stats_wolbachia.cc:131
double getMeanOffsprgInfection(unsigned int sex)
Definition: stats_wolbachia.cc:105
void setInfectionStats()
Definition: stats_wolbachia.cc:35
References StatHandlerBase::_pop, StatHandler< SH >::add(), ADULTS, getDemicExtinctionRate(), getDemicInfectionVar(), getMeanFemaleInfection_perPatch(), getMeanInfection(), getMeanOffsprgInfection(), Metapop::getPatchNbr(), OFFSPRG, and setInfectionStats().
◆ _extrate
| double TTWolbachiaSH::_extrate |
|
private |
◆ _Fmean
| double TTWolbachiaSH::_Fmean |
|
private |
◆ _Mmean
| double TTWolbachiaSH::_Mmean |
|
private |
◆ _trait
◆ _TTidx
| int TTWolbachiaSH::_TTidx |
|
private |
◆ _var
| double TTWolbachiaSH::_var |
|
private |
The documentation for this class was generated from the following files: