56 typedef std::list< StatRecBase* >::iterator
STAT_IT;
89 virtual void reset ( );
93 virtual void init ( );
115 typedef typename std::list< StatRecorder<SH>* >::iterator
REC_IT;
144 double(SH::* getStatNoArg)(
void),
double(SH::* getStatOneArg)(
unsigned int),
145 double(SH::* getStatTwoArg)(
unsigned int,
unsigned int),
void(SH::* setStat)(
void))
149 new_rec->
set(Title, Name, AGE, ARG1, ARG2,
150 getStatNoArg, getStatOneArg, getStatTwoArg, setStat);
152 new_rec->
setHandler(
dynamic_cast<SH*
> (
this));
180 _SHLinkedTrait = trait_proto;
181 _SHLinkedTraitIndex = trait_proto->get_index();
200 _SHLinkedEvent = lce;
Template class for the LCEs StatHandler classes.
Definition: stathandler.h:189
LCE * _SHLinkedEvent
Pointer to the linked LCE.
Definition: stathandler.h:192
EventStatHandler(LCE *lce)
Definition: stathandler.h:198
virtual ~EventStatHandler()
Definition: stathandler.h:195
Service handler (an observer).
Definition: handler.h:35
Base class of the StatHandler class, implements the Handler interface.
Definition: stathandler.h:47
virtual void update()
This function is left empty as the StatServices calls StatRecorder::setVal directly.
Definition: stathandler.h:95
void set_service(StatServices *srv)
Definition: stathandler.h:72
std::list< StatRecBase * > & getStats()
Definition: stathandler.h:84
Metapop * get_pop_ptr()
Definition: stathandler.h:70
std::list< StatRecBase * > _stats
Link to the StatRecorder list elements in the StatHandler derived class.
Definition: stathandler.h:51
unsigned int getCurrentOccurrence()
Definition: stathandler.h:80
virtual void add(StatRecBase *rec)
Definition: stathandler.h:86
virtual bool setStatRecorders(std::string &token)=0
unsigned int getOccurrence()
Definition: stathandler.h:76
std::list< StatRecBase * >::iterator STAT_IT
Definition: stathandler.h:56
virtual ~StatHandlerBase()
Definition: stathandler.h:66
virtual void reset()
Empties the _stats list and calls clear() (defined in the derived class).
Definition: stathandler.cc:52
virtual void init()
Definition: stathandler.cc:38
StatHandlerBase()
Definition: stathandler.h:64
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:60
unsigned int getNbRecorders()
Definition: stathandler.h:82
StatServices * get_service()
Definition: stathandler.h:74
StatServices * _service
Link to the StatService.
Definition: stathandler.h:54
unsigned int getNumOccurrences()
Definition: stathandler.h:78
A class to compute and store the summary statistics associated with a SimComponent.
Definition: stathandler.h:109
virtual void clear()
Empties the _recorders list, they are destroyed in StatHandlerBase::reset().
Definition: stathandler.h:124
StatHandler()
Definition: stathandler.h:119
std::list< StatRecorder< SH > * > _recorders
The list of stat recorders.
Definition: stathandler.h:113
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:143
std::list< StatRecorder< SH > * >::iterator REC_IT
Definition: stathandler.h:115
virtual ~StatHandler()
Definition: stathandler.h:121
Base class for the StatRecorder's, declares the interface to record stat values.
Definition: statrecorder.h:37
void setHandler(S *theHandler)
Sets the pointer to the StatHandler that owns this recorder.
Definition: statrecorder.h:128
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:144
The Service class used to manage the StatHandler objects.
Definition: statservices.h:49
unsigned int getNumOccurrences()
Returns the maximum number of generation records per replicate.
Definition: statservices.h:125
Metapop * get_pop_ptr()
Definition: statservices.h:105
unsigned int getCurrentOccurrence()
Returns the last generation recorded for current replicate.
Definition: statservices.h:135
unsigned int getOccurrence()
Definition: statservices.h:117
Template class for the trait's StatHandler.
Definition: stathandler.h:167
virtual ~TraitStatHandler()
Definition: stathandler.h:175
int _SHLinkedTraitIndex
Index of the trait in the Individual::Traits table.
Definition: stathandler.h:172
TraitStatHandler(TP *trait_proto)
Definition: stathandler.h:178
TP * _SHLinkedTrait
Pointer to a TraitProtoype object.
Definition: stathandler.h:170
unsigned int age_t
Age class flags.
Definition: types.h:45