57 typedef std::list< StatRecBase* >::iterator
STAT_IT;
90 virtual void reset ( );
94 virtual void init ( );
116 typedef typename std::list< StatRecorder<SH>* >::iterator
REC_IT;
145 double(SH::* getStatNoArg)(
void),
double(SH::* getStatOneArg)(
unsigned int),
146 double(SH::* getStatTwoArg)(
unsigned int,
unsigned int),
void(SH::* setStat)(
void))
150 new_rec->
set(Title, Name, AGE, ARG1, ARG2,
151 getStatNoArg, getStatOneArg, getStatTwoArg, setStat);
153 new_rec->
setHandler(
dynamic_cast<SH*
> (
this));
181 _SHLinkedTrait = trait_proto;
182 _SHLinkedTraitIndex = trait_proto->get_index();
201 _SHLinkedEvent = lce;
Template class for the LCEs StatHandler classes.
Definition: stathandler.h:190
LCE * _SHLinkedEvent
Pointer to the linked LCE.
Definition: stathandler.h:193
EventStatHandler(LCE *lce)
Definition: stathandler.h:199
virtual ~EventStatHandler()
Definition: stathandler.h:196
Service handler (an observer).
Definition: handler.h:36
Base class of the StatHandler class, implements the Handler interface.
Definition: stathandler.h:48
virtual void update()
This function is left empty as the StatServices calls StatRecorder::setVal directly.
Definition: stathandler.h:96
void set_service(StatServices *srv)
Definition: stathandler.h:73
std::list< StatRecBase * > & getStats()
Definition: stathandler.h:85
Metapop * get_pop_ptr()
Definition: stathandler.h:71
std::list< StatRecBase * >::iterator STAT_IT
Definition: stathandler.h:57
std::list< StatRecBase * > _stats
Link to the StatRecorder list elements in the StatHandler derived class.
Definition: stathandler.h:52
unsigned int getCurrentOccurrence()
Definition: stathandler.h:81
virtual void add(StatRecBase *rec)
Definition: stathandler.h:87
virtual bool setStatRecorders(std::string &token)=0
unsigned int getOccurrence()
Definition: stathandler.h:77
virtual ~StatHandlerBase()
Definition: stathandler.h:67
virtual void reset()
Empties the _stats list and calls clear() (defined in the derived class).
Definition: stathandler.cc:53
virtual void init()
Definition: stathandler.cc:39
StatHandlerBase()
Definition: stathandler.h:65
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
unsigned int getNbRecorders()
Definition: stathandler.h:83
StatServices * get_service()
Definition: stathandler.h:75
StatServices * _service
Link to the StatService.
Definition: stathandler.h:55
unsigned int getNumOccurrences()
Definition: stathandler.h:79
A class to compute and store the summary statistics associated with a SimComponent.
Definition: stathandler.h:110
virtual void clear()
Empties the _recorders list, they are destroyed in StatHandlerBase::reset().
Definition: stathandler.h:125
StatHandler()
Definition: stathandler.h:120
std::list< StatRecorder< SH > * >::iterator REC_IT
Definition: stathandler.h:116
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
std::list< StatRecorder< SH > * > _recorders
The list of stat recorders.
Definition: stathandler.h:114
virtual ~StatHandler()
Definition: stathandler.h:122
Base class for the StatRecorder's, declares the interface to record stat values.
Definition: statrecorder.h:38
Stores the pointers to the StatHandler's stat functions.
Definition: statrecorder.h:93
void setHandler(S *theHandler)
Sets the pointer to the StatHandler that owns this recorder.
Definition: statrecorder.h:129
void set(std::string T, std::string N, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(S::*getNoArg)(void), double(S::*getOneArg)(unsigned int), double(S::*getTwoArg)(unsigned int, unsigned int), void(S::*setStat)(void))
Sets the recorder attributes.
Definition: statrecorder.h:145
The Service class used to manage the StatHandler objects.
Definition: statservices.h:50
unsigned int getNumOccurrences()
Returns the maximum number of generation records per replicate.
Definition: statservices.h:126
unsigned int getCurrentOccurrence()
Returns the last generation recorded for current replicate.
Definition: statservices.h:136
Metapop * get_pop_ptr()
Definition: statservices.h:106
unsigned int getOccurrence()
Definition: statservices.h:118
Template class for the trait's StatHandler.
Definition: stathandler.h:168
virtual ~TraitStatHandler()
Definition: stathandler.h:176
int _SHLinkedTraitIndex
Index of the trait in the Individual::Traits table.
Definition: stathandler.h:173
TraitStatHandler(TP *trait_proto)
Definition: stathandler.h:179
TP * _SHLinkedTrait
Pointer to a TraitProtoype object.
Definition: stathandler.h:171
unsigned int age_t
Age class flags.
Definition: types.h:46