Nemo
2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
|
StatHandler for the DBMI trait. More...
#include <ttbdmi.h>
Public Member Functions | |
TTBDMI_SH (TProtoBDMI *TP) | |
virtual | ~TTBDMI_SH () |
virtual bool | setStatRecorders (std::string &token) |
void | addStats (age_t AGE) |
void | setAdultStats () |
void | setOffsprgStats () |
void | setStats (age_idx agex, void(TTBDMI_SH::*cntFunc)(Patch *, sex_t, age_idx, double **, double **)) |
void | countAllele_haplo (Patch *patch, sex_t SEX, age_idx AGE, double **frqTab, double **icpTab) |
void | countAllele_diplo (Patch *patch, sex_t SEX, age_idx AGE, double **frqTab, double **icpTab) |
double | getFreq () |
double | getFreqIcmp () |
double | getPatchFreq (unsigned int i) |
double | getPatchIcmp (unsigned int i) |
![]() | |
TraitStatHandler (TProtoBDMI *trait_proto) | |
virtual | ~TraitStatHandler () |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
virtual void | init ()=0 |
Inits state. More... | |
virtual void | update ()=0 |
Updates the handler state. More... | |
virtual | ~Handler () |
Private Attributes | |
double | _freq |
double | _freqIcomp |
double * | _patchFreq |
double * | _patchIcmp |
Additional Inherited Members | |
![]() | |
typedef std::list< StatRecorder< SH > * >::iterator | REC_IT |
![]() | |
TProtoBDMI * | _SHLinkedTrait |
Pointer to a TraitProtoype object. More... | |
int | _SHLinkedTraitIndex |
Index of the trait in the Individual::Traits table. More... | |
![]() | |
std::list< StatRecorder< SH > * > | _recorders |
The list of stat recorders. More... | |
![]() | |
Metapop * | _pop |
Link to the current population, set through the link to the StatService. More... | |
StatHandler for the DBMI trait.
Records the average allele frequencies at all loci, and the frequencies of incompatibilities (i.e. double heterozygotes).
|
inline |
|
inlinevirtual |
References _patchFreq, and _patchIcmp.
void TTBDMI_SH::addStats | ( | age_t | AGE | ) |
References StatHandlerBase::_pop, StatHandler< SH >::add(), ADULTS, getFreq(), getFreqIcmp(), getPatchFreq(), getPatchIcmp(), Metapop::getPatchNbr(), setAdultStats(), and setOffsprgStats().
Referenced by setStatRecorders().
void TTBDMI_SH::countAllele_diplo | ( | Patch * | patch, |
sex_t | SEX, | ||
age_idx | AGE, | ||
double ** | frqTab, | ||
double ** | icpTab | ||
) |
References TraitStatHandler< TProtoBDMI, TTBDMI_SH >::_SHLinkedTrait, TraitStatHandler< TProtoBDMI, TTBDMI_SH >::_SHLinkedTraitIndex, Patch::get(), TProtoBDMI::get_nb_locus(), TT_BDMI::get_num_mut_diplo(), Patch::getID(), Individual::getTrait(), and Patch::size().
Referenced by setAdultStats(), and setOffsprgStats().
void TTBDMI_SH::countAllele_haplo | ( | Patch * | patch, |
sex_t | SEX, | ||
age_idx | AGE, | ||
double ** | frqTab, | ||
double ** | icpTab | ||
) |
References TraitStatHandler< TProtoBDMI, TTBDMI_SH >::_SHLinkedTrait, TraitStatHandler< TProtoBDMI, TTBDMI_SH >::_SHLinkedTraitIndex, Patch::get(), TProtoBDMI::get_nb_locus(), TT_BDMI::get_num_mut_haplo(), Patch::getID(), Individual::getTrait(), and Patch::size().
Referenced by setAdultStats(), and setOffsprgStats().
|
inline |
|
inline |
|
inline |
|
inline |
void TTBDMI_SH::setAdultStats | ( | ) |
References TraitStatHandler< TProtoBDMI, TTBDMI_SH >::_SHLinkedTrait, ADLTx, countAllele_diplo(), countAllele_haplo(), TProtoBDMI::isHaploid(), and setStats().
Referenced by addStats().
void TTBDMI_SH::setOffsprgStats | ( | ) |
References TraitStatHandler< TProtoBDMI, TTBDMI_SH >::_SHLinkedTrait, countAllele_diplo(), countAllele_haplo(), TProtoBDMI::isHaploid(), OFFSx, and setStats().
Referenced by addStats().
|
virtual |
Implements StatHandlerBase.
References addStats(), ADULTS, message(), and OFFSPRG.
void TTBDMI_SH::setStats | ( | age_idx | agex, |
void(TTBDMI_SH::*)(Patch *, sex_t, age_idx, double **, double **) | cntFunc | ||
) |
References _freq, _freqIcomp, _patchFreq, _patchIcmp, StatHandlerBase::_pop, TraitStatHandler< TProtoBDMI, TTBDMI_SH >::_SHLinkedTrait, FEM, TProtoBDMI::get_nb_locus(), Metapop::getPatch(), Metapop::getPatchNbr(), TProtoBDMI::isHaploid(), MAL, and Patch::size().
Referenced by setAdultStats(), and setOffsprgStats().
|
private |
Referenced by getFreq(), and setStats().
|
private |
Referenced by getFreqIcmp(), and setStats().
|
private |
Referenced by getPatchFreq(), setStats(), and ~TTBDMI_SH().
|
private |
Referenced by getPatchIcmp(), setStats(), and ~TTBDMI_SH().