|
| | 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) |
| |
Public Member Functions inherited from TraitStatHandler< TProtoBDMI, TTBDMI_SH > |
| | TraitStatHandler (TProtoBDMI *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 for the DBMI trait.
Records the average allele frequencies at all loci, and the frequencies of incompatibilities (i.e. double heterozygotes).
881 unsigned int i, nb_ind = 0, nb_patch = 0;
883 unsigned int num_pair;
884 unsigned int psize=0;
887 Patch* current_patch;
889 num_pair = nb_locus/2;
891 double* freqTable =
new double [nb_locus];
892 double* icmpTable =
new double [num_pair];
893 double** patchFreqTable =
new double* [npatch];
894 double** patchIcmpTable =
new double* [npatch];
896 for(i = 0; i < nb_locus; ++i)
899 for(i = 0; i < num_pair; ++i)
910 for(i = 0; i < npatch; ++i) {
914 patchFreqTable[i] =
new double [nb_locus];
915 for(
unsigned int j = 0; j < nb_locus; ++j) patchFreqTable[i][j] = 0;
917 patchIcmpTable[i] =
new double [num_pair];
918 for(
unsigned int j = 0; j < num_pair; ++j) patchIcmpTable[i][j] = 0;
923 if( (psize = current_patch->
size(agex)) == 0)
continue;
929 (this->* cntFunc) (current_patch,
FEM, agex, patchFreqTable, patchIcmpTable);
930 (this->* cntFunc) (current_patch,
MAL, agex, patchFreqTable, patchIcmpTable);
933 for(
unsigned int k = 0; k < nb_locus; ++k)
940 for(
unsigned int k = 0; k < num_pair; ++k)
966 for(i = 0; i < npatch; ++i) {
967 delete [] patchFreqTable[i];
968 delete [] patchIcmpTable[i];
970 delete [] patchFreqTable;
971 delete [] patchIcmpTable;
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:432
@ FEM
Definition: types.h:37
@ MAL
Definition: types.h:37
References _freq, _freqIcomp, _patchFreq, _patchIcmp, StatHandlerBase::_pop, TraitStatHandler< TProtoBDMI, TTBDMI_SH >::_SHLinkedTrait, FEM, TProtoBDMI::get_num_locus(), Metapop::getPatch(), Metapop::getPatchNbr(), TProtoBDMI::isHaploid(), MAL, and Patch::size().
Referenced by setAdultStats(), and setOffsprgStats().