Nemo  2.4.2
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
StatServices Class Reference

The Service class used to manage the StatHandler objects. More...

#include <statservices.h>

+ Inheritance diagram for StatServices:
+ Collaboration diagram for StatServices:

Public Types

typedef list< StatHandlerBase * >::const_iterator stat_it
 
typedef list< StatRecBase * >::const_iterator rec_it
 

Public Member Functions

 StatServices ()
 
virtual ~StatServices ()
 
virtual bool init ()
 
Metapopget_pop_ptr ()
 
void set_pop_ptr (Metapop *pop)
 
void set (string &str, unsigned int occ)
 
void setStatOptions (string &str)
 
string & getStatArg ()
 
unsigned int getOccurrence ()
 
void setOcccurrence (unsigned int value)
 
void setOccurrences (map< unsigned int, unsigned int > timeTable)
 Sets the list of generation for which statistics must be recorded during a run. More...
 
unsigned int getNumOccurrences ()
 Returns the maximum number of generation records per replicate. More...
 
unsigned int getNumOccurrences (unsigned int replicate)
 Returns the number of generation records present in the stat table for a replicate. More...
 
unsigned int getCurrentOccurrence ()
 Returns the last generation recorded for current replicate. More...
 
void resetCurrentOccurrence ()
 Resets the occurrence iterator to the beginning of the list of generation occurrences. More...
 
void printStatHeaders (ofstream &FH)
 
void doPrintAverages ()
 
void cancelPrintAverages ()
 
bool getPrintAveragesOpt ()
 
void printStatValue (ofstream &FH, unsigned int repl_idx)
 Prints the stat values to the '.txt' output file. More...
 
void printStatAverage (ofstream &FH)
 
void setCompactOutputFormat ()
 
void setFieldWidth (unsigned int val)
 
void setFieldPrecision (unsigned int val)
 
void setFieldSeparator (unsigned char c)
 
void setDefaultOutputFormat ()
 
list< StatRecBase * > getAllStats ()
 
unsigned int getNumStats ()
 
stat_it getFirst ()
 
stat_it getLast ()
 
vector< double * > * getReplicateStatRecords (unsigned int replicate)
 
double * getGenerationStatValues (unsigned int replicate, unsigned int occurence) const
 
void copyGenerationStatValues (unsigned int replicate, unsigned int occurence, double *values, unsigned int size)
 
void recordStats (unsigned int gen)
 record stat values in stat table by calling all stat recorders. More...
 
virtual void notify ()
 
virtual void load (SimComponent *sc)
 tell the SimComponent to load its stat handlers More...
 
virtual void attach (Handler *H)
 attach the StatHandler to the current list (_statHandlers) of the StatServices More...
 
virtual void reset ()
 clear the list of StatHandler More...
 
void reset_stat_table ()
 Deletes the stat tables. More...
 
- Public Member Functions inherited from Service
 Service ()
 
virtual ~Service ()
 

Private Attributes

Metapop_popPtr
 
list< StatHandlerBase * > _statHandlers
 List of stat handlers declared by currently active simulation components. More...
 
list< StatRecBase * > _statRecorders
 List of stat recorders. More...
 
unsigned int _numRecorders
 Number of stats to record. More...
 
vector< vector< double * > > _statValues
 Table containing all recorded stats, replicate x generation x (num recorders + 2) . More...
 
double * _currentStatValues
 Pointer to the last recorded stats. More...
 
string _statArg
 The string argument of the 'stat' input option. More...
 
unsigned int _occurrence
 Deprecated. More...
 
list< unsigned int > _occurrences
 List of all generations to record. More...
 
list< unsigned int >::const_iterator _current_occurrence
 Iterator pointing to the current generation to record. More...
 
unsigned int _width
 
unsigned int _precision
 
unsigned char _separator
 
bool _printAverages
 

Detailed Description

The Service class used to manage the StatHandler objects.

Member Typedef Documentation

◆ rec_it

typedef list< StatRecBase* >::const_iterator StatServices::rec_it

◆ stat_it

typedef list< StatHandlerBase* >::const_iterator StatServices::stat_it

Constructor & Destructor Documentation

◆ StatServices()

StatServices::StatServices ( )
inline
98  { }
Metapop * _popPtr
Definition: statservices.h:52
unsigned char _separator
Definition: statservices.h:86
unsigned int _occurrence
Deprecated.
Definition: statservices.h:73
unsigned int _width
Definition: statservices.h:84
unsigned int _precision
Definition: statservices.h:84
unsigned int _numRecorders
Number of stats to record.
Definition: statservices.h:61
bool _printAverages
Definition: statservices.h:88
double * _currentStatValues
Pointer to the last recorded stats.
Definition: statservices.h:67

◆ ~StatServices()

virtual StatServices::~StatServices ( )
inlinevirtual
100 { reset_stat_table(); }
void reset_stat_table()
Deletes the stat tables.
Definition: statservices.cc:238

Member Function Documentation

◆ attach()

void StatServices::attach ( Handler H)
virtual

attach the StatHandler to the current list (_statHandlers) of the StatServices

Parameters
Hthe StatHandler

Implements Service.

176 {
177  StatHandlerBase* SH = dynamic_cast<StatHandlerBase*> (H);
178 
179  _statHandlers.push_back(SH);
180 
181  SH->set_service(this);
182 }
Base class of the StatHandler class, implements the Handler interface.
Definition: stathandler.h:46
void set_service(StatServices *srv)
Definition: stathandler.h:71
list< StatHandlerBase * > _statHandlers
List of stat handlers declared by currently active simulation components.
Definition: statservices.h:55

References StatHandlerBase::set_service().

Referenced by LCE_Selection_base::loadStatServices(), Metapop::loadStatServices(), TProtoBDMI::loadStatServices(), TProtoDeletMutations_bitstring::loadStatServices(), TProtoDispersal::loadStatServices(), TProtoNeutralGenes::loadStatServices(), TProtoQuanti::loadStatServices(), and TProtoWolbachia::loadStatServices().

+ Here is the caller graph for this function:

◆ cancelPrintAverages()

void StatServices::cancelPrintAverages ( )
inline
141 {_printAverages = 0;}

Referenced by LCE_StatServiceNotifier::loadStatServices().

+ Here is the caller graph for this function:

◆ copyGenerationStatValues()

void StatServices::copyGenerationStatValues ( unsigned int  replicate,
unsigned int  occurence,
double *  values,
unsigned int  size 
)
inline
182  {
183  assert( _statValues[ replicate-1 ].size() < _occurrences.size() );
184 
185  assert( size == _numRecorders+2);
186 
187  double* new_record = new double[size];
188 
189  memcpy(new_record, values, size*sizeof(double));
190 
191  _statValues[ replicate-1 ].push_back(new_record);
192  }
list< unsigned int > _occurrences
List of all generations to record.
Definition: statservices.h:76
vector< vector< double * > > _statValues
Table containing all recorded stats, replicate x generation x (num recorders + 2) .
Definition: statservices.h:64

◆ doPrintAverages()

void StatServices::doPrintAverages ( )
inline
140 {_printAverages = 1;}

Referenced by LCE_StatServiceNotifier::loadStatServices().

+ Here is the caller graph for this function:

◆ get_pop_ptr()

Metapop* StatServices::get_pop_ptr ( )
inline
104 {return _popPtr;}

Referenced by StatHandlerBase::get_pop_ptr().

+ Here is the caller graph for this function:

◆ getAllStats()

list< StatRecBase * > StatServices::getAllStats ( )
404 {
405  list< StatHandlerBase* >::iterator HIT = _statHandlers.begin();
406 
407  list<StatRecBase*> allStats, stats;
408 
409  while(HIT != _statHandlers.end()) {
410  stats = (*HIT)->getStats();
411  allStats.insert(allStats.end(), stats.begin(), stats.end());
412  HIT++;
413  }
414 
415  return allStats;
416 }

Referenced by SimRunner::get_allRegisteredStats().

+ Here is the caller graph for this function:

◆ getCurrentOccurrence()

unsigned int StatServices::getCurrentOccurrence ( )
inline

Returns the last generation recorded for current replicate.

134 {return *_current_occurrence;}
list< unsigned int >::const_iterator _current_occurrence
Iterator pointing to the current generation to record.
Definition: statservices.h:81

Referenced by StatHandlerBase::getCurrentOccurrence().

+ Here is the caller graph for this function:

◆ getFirst()

stat_it StatServices::getFirst ( )
inline
166 {return _statHandlers.begin();}

◆ getGenerationStatValues()

double* StatServices::getGenerationStatValues ( unsigned int  replicate,
unsigned int  occurence 
) const
inline
176  {
177  assert(occurence < _occurrences.size());
178  return _statValues[ replicate-1 ][ occurence ];
179  }

◆ getLast()

stat_it StatServices::getLast ( )
inline
168 {return _statHandlers.end();}

◆ getNumOccurrences() [1/2]

unsigned int StatServices::getNumOccurrences ( )
inline

Returns the maximum number of generation records per replicate.

124 {return _occurrences.size();}

Referenced by StatHandlerBase::getNumOccurrences().

+ Here is the caller graph for this function:

◆ getNumOccurrences() [2/2]

unsigned int StatServices::getNumOccurrences ( unsigned int  replicate)
inline

Returns the number of generation records present in the stat table for a replicate.

Parameters
replicatethe replicate number (not the index in the stat table).
130  {
131  return _statValues[replicate-1].size();
132  }

◆ getNumStats()

unsigned int StatServices::getNumStats ( )
inline
164 {return _statRecorders.size();}
list< StatRecBase * > _statRecorders
List of stat recorders.
Definition: statservices.h:58

◆ getOccurrence()

unsigned int StatServices::getOccurrence ( )
inline
116 {return _occurrence;}

Referenced by LCE_StatServiceNotifier::execute(), and StatHandlerBase::getOccurrence().

+ Here is the caller graph for this function:

◆ getPrintAveragesOpt()

bool StatServices::getPrintAveragesOpt ( )
inline
142 {return _printAverages;}

Referenced by LCE_StatFH::FHwrite().

+ Here is the caller graph for this function:

◆ getReplicateStatRecords()

vector<double*>* StatServices::getReplicateStatRecords ( unsigned int  replicate)
inline
171  {
172  return &_statValues[ replicate-1 ];
173  }

◆ getStatArg()

string& StatServices::getStatArg ( )
inline
113 {return _statArg;}
string _statArg
The string argument of the 'stat' input option.
Definition: statservices.h:70

◆ init()

bool StatServices::init ( )
virtual

Implements Service.

46 {
47  stat_it HIT;
48 
49  HIT = _statHandlers.begin();
50 
51  //first init the stat handlers -> will define the dims of the stat tables
52  while(HIT != _statHandlers.end()) {
53  (*HIT)->init();
54  HIT++;
55  }
56 
57  istringstream stats(_statArg);
58  string arg;
59  list<string> args;
60 
61  //extract the stat options from the string read in the init file
62  while(stats>>arg) args.push_back(arg);
63 
64  list<string>::iterator token = args.begin();
65 
66  bool is_set = false;
67 
68  while(token != args.end()) {
69 
70  HIT = _statHandlers.begin();
71 
72  is_set = false;
73 
74  while(HIT != _statHandlers.end() && !is_set) {
75  is_set |= (*HIT)->setStatRecorders( (*token) );
76  HIT++;
77  }
78 
79  if(!is_set) {
80  error("the string \"%s\" is not a valid stat option\n",(*token).c_str());
81  return false;
82  }
83 
84  token++;
85  }
86 
87  //---- set the list of stat recorders:
88  _statRecorders.clear();
89 
90  for (HIT = _statHandlers.begin(); HIT != _statHandlers.end(); ++HIT) {
91 
92  _statRecorders.splice(_statRecorders.end(), (*HIT)->getStats());
93  //this removes the recorders from the handler's list (in principle)
94  //this means we need to delete the recorders within the StatServices!!
95  }
96 
98 
99 
100  //---- set iterator to first generation occurrence to record
102  //this is safe as the occurrence list is set before init() is called.
103 
104 // //reset output option for per-gen mean stats
105 // _printAverages = 1; //this resets user-defined option!!
106 
107  //---- set the stat table:
109 
110  for (unsigned int i = 0; i < SIMenv::getReplicates(); ++i) {
111  _statValues.push_back(vector<double*>());
112  }
113 
114  return true;
115 }
static unsigned int getReplicates()
Definition: simenv.h:61
list< StatHandlerBase * >::const_iterator stat_it
Definition: statservices.h:92
int error(const char *str,...)
Definition: output.cc:77

References error(), and SIMenv::getReplicates().

Referenced by SimRunner::init_components().

+ Here is the caller graph for this function:

◆ load()

void StatServices::load ( SimComponent sc)
virtual

tell the SimComponent to load its stat handlers

Parameters
scthe SimComponent

Implements Service.

169 {
170  sc->loadStatServices(this);
171 }
virtual void loadStatServices(StatServices *loader)=0
Loads the component's StatHandler onto the StatServices.

References SimComponent::loadStatServices().

Referenced by SimRunner::register_component().

+ Here is the caller graph for this function:

◆ notify()

void StatServices::notify ( )
virtual

Implements Service.

187 {
188 #ifdef _DEBUG_
189  message("StatServices::notify (%i/%i): ", SIMenv::getCurrentGeneration(),
191  fflush(stdout);
192 #endif
193 
197  }
198 
199 #ifdef _DEBUG_
200  message("\n");
201 #endif
202 }
static unsigned int getCurrentGeneration()
Definition: simenv.h:58
void recordStats(unsigned int gen)
record stat values in stat table by calling all stat recorders.
Definition: statservices.cc:253
void message(const char *message,...)
Definition: output.cc:38

References SIMenv::getCurrentGeneration(), and message().

Referenced by LCE_StatServiceNotifier::execute().

+ Here is the caller graph for this function:

◆ printStatAverage()

void StatServices::printStatAverage ( ofstream &  FH)
336 {
337  vector< double > means;
338  vector< unsigned int > stat_rep_cntr;
339  unsigned int num_repl = SIMenv::getReplicates(), rep_cntr;
340  unsigned int num_gen = getNumOccurrences();
341  unsigned int current_gen = 0;
342 
343  //print the first row with stats headers:
344 // FH.setf(ios::left,ios::adjustfield);
345  FH << setw(_width) << left <<"generation";
346 
347  //print the stat names:
348  printStatHeaders(FH);
349 
350  FH<< _separator << setw(_width) << "alive.rpl" << endl;
351 
352 // FH << setprecision(_precision);
353 
354  for (unsigned int gen = 0; gen < num_gen; ++gen) {
355 
356  rep_cntr = 0;
357 
358  means.assign(_numRecorders,0);
359  stat_rep_cntr.assign(_numRecorders, 0);
360 
361  for (unsigned int rep = 0; rep < num_repl; ++rep) {
362 
363  //verify if this replicate was not extinct at this generation
364  if ( _statValues[ rep ].size() > gen) rep_cntr++;
365  else continue; //skip this replicate
366 
367  for (unsigned int j = 0, pos = 0; j < _numRecorders; ++j) {
368  pos = j+2;
369  // verify that the value is not NAN
370  if( !isnan(_statValues[ rep ][ gen ][pos]) ) {
371  means[j] += _statValues[rep][gen][pos]; //two first are replicate and generation
372  stat_rep_cntr[j]++;
373  }
374  }
375  current_gen = _statValues[rep][gen][1];
376  }
377 
378  if(rep_cntr != 0) {
379 
380 // FH.width(_width);
381 // FH.setf(ios::left,ios::adjustfield);
382  //FH<<_statValues[0][gen][1];
383  FH << setw(_width) << left << current_gen;
384 
385  FH << setprecision(_precision);
386 
387  for (unsigned int j = 0; j < _numRecorders; ++j) {
388  FH << _separator << setw(_width) << means[j] / stat_rep_cntr[j];
389  }
390  //print number of alive replicates 'til this generation
391  FH << _separator << setw(_width) << rep_cntr;
392 
393  FH << endl;
394  }
395 
396  }
397 
398 
399 }
unsigned int getNumOccurrences()
Returns the maximum number of generation records per replicate.
Definition: statservices.h:124
void printStatHeaders(ofstream &FH)
Definition: statservices.cc:278

References SIMenv::getReplicates().

Referenced by LCE_StatFH::PrintStat_byGen().

+ Here is the caller graph for this function:

◆ printStatHeaders()

void StatServices::printStatHeaders ( ofstream &  FH)
279 {
280  for (rec_it IT = _statRecorders.begin(); IT != _statRecorders.end(); ++IT) {
281  FH << _separator << setw(_width) << (*IT)->getName();
282  }
283 }
list< StatRecBase * >::const_iterator rec_it
Definition: statservices.h:94

◆ printStatValue()

void StatServices::printStatValue ( ofstream &  FH,
unsigned int  repl_idx 
)

Prints the stat values to the '.txt' output file.

Parameters
FHthe file output stream
repl_idxthe replicate index in the stat tables
288 {
289 
290 // FH.width(_width);
291 // FH.setf(ios::left,ios::adjustfield);
292 
293  if(SIMenv::getCurrentReplicate() == 1) {
294 
295  //print the first row with stat headers:
296  FH << setw(_width) << left <<"replicate"<< _separator << setw(_width) <<"generation";
297 
298  //print the stat names:
299  printStatHeaders(FH);
300 
301  FH << endl;
302  }
303 
304  for (unsigned int gen = 0, i = 2; gen < _statValues[repl_idx].size(); ++gen) {
305  //for all generations recorded, print stuff:
306 
307  assert( repl_idx + 1 == _statValues[repl_idx][gen][0]); //check if replicate is ok
308 
309 // FH.width(_width);
310  FH << setw(_width) << left << _statValues[repl_idx][gen][0]; //replicate number
311  FH << _separator;
312  FH << setprecision(16); //to avoid scientific notation for generation number
313  FH << setw(_width) << _statValues[repl_idx][gen][1]; //generation recorded
314  FH << setprecision(_precision); //this precision is needed only for stat values
315 
316  i = 2;
317  //print all stats on one line
318  for (rec_it IT = _statRecorders.begin(); IT != _statRecorders.end(); ++IT) {
319 
320  FH << _separator << setw(_width) << _statValues[repl_idx][gen][i];
321 
322  i++;
323 
324  }
325 
326  FH<<endl;
327 
328  assert( i == _numRecorders + 2 );
329  }
330 
331 }
static unsigned int getCurrentReplicate()
Definition: simenv.h:60

References SIMenv::getCurrentReplicate().

Referenced by LCE_StatFH::FHwrite().

+ Here is the caller graph for this function:

◆ recordStats()

void StatServices::recordStats ( unsigned int  gen)

record stat values in stat table by calling all stat recorders.

254 {
255  _currentStatValues = new double [ _numRecorders + 2]; //+ replicate + generation
256 
258  _currentStatValues[1] = gen;
259 
260  unsigned int i = 2, tab_idx = SIMenv::getCurrentReplicate() - 1;
261 
262  for (rec_it REC = _statRecorders.begin(); REC != _statRecorders.end(); ++REC)
263  {
264 
265  assert(i < _numRecorders+2 );
266 
267  _currentStatValues[i++] = (*REC)->setVal( _popPtr->getCurrentAge() );
268 
269  }
270 
271  _statValues[ tab_idx ].push_back(_currentStatValues);
272 
273  assert( _statValues[ tab_idx ].size() <= getNumOccurrences() );
274 }
age_t getCurrentAge()
Definition: metapop.h:297

References SIMenv::getCurrentReplicate().

◆ reset()

void StatServices::reset ( )
virtual

clear the list of StatHandler

Implements Service.

207 {
208 #ifdef _DEBUG_
209  message("StatServices::reset\n");
210 #endif
211 
212  stat_it HIT = _statHandlers.begin();
213 
214  while(HIT != _statHandlers.end()) {
215  (*HIT)->reset();
216  HIT++;
217  }
218 
219  _statHandlers.clear();
220 
221  //the stat recorders must be freed here, they have been removed from the StatHandlers
222  rec_it REC = _statRecorders.begin();
223 
224  for(; REC != _statRecorders.end(); ++REC) delete (*REC);
225 
226  _statRecorders.clear();
227 
229 
230 #ifdef _DEBUG_
231  message("StatServices::reset done\n");
232 #endif
233 
234 }

References message().

Referenced by SimRunner::reset_services().

+ Here is the caller graph for this function:

◆ reset_stat_table()

void StatServices::reset_stat_table ( )

Deletes the stat tables.

239 {
240  for (unsigned int i = 0; i < _statValues.size(); ++i) {
241  for (unsigned int j = 0; j < _statValues[i].size(); ++j) {
242  delete [] _statValues[i][j];
243  }
244  _statValues[i].clear();
245  }
246  _statValues.clear();
247 
248  _currentStatValues = 0;
249 }

◆ resetCurrentOccurrence()

void StatServices::resetCurrentOccurrence ( )
inline

Resets the occurrence iterator to the beginning of the list of generation occurrences.

Referenced by SimRunner::setForFirstGeneration().

+ Here is the caller graph for this function:

◆ set()

void StatServices::set ( string &  str,
unsigned int  occ 
)
inline
109  {_statArg = str; _occurrence = occ;}

◆ set_pop_ptr()

void StatServices::set_pop_ptr ( Metapop pop)
inline
106 {_popPtr=pop;}

Referenced by SimRunner::init_components().

+ Here is the caller graph for this function:

◆ setCompactOutputFormat()

void StatServices::setCompactOutputFormat ( )
inline
151 {_width = 0; _separator = ' ';}

Referenced by LCE_StatServiceNotifier::setParameters().

+ Here is the caller graph for this function:

◆ setDefaultOutputFormat()

void StatServices::setDefaultOutputFormat ( )
inline
159 {_width = 12; _precision = 6; _separator = '\t';}

Referenced by LCE_StatServiceNotifier::setParameters().

+ Here is the caller graph for this function:

◆ setFieldPrecision()

void StatServices::setFieldPrecision ( unsigned int  val)
inline
155 {_precision = val;}

Referenced by LCE_StatServiceNotifier::setParameters().

+ Here is the caller graph for this function:

◆ setFieldSeparator()

void StatServices::setFieldSeparator ( unsigned char  c)
inline
157 {_separator = c;}

Referenced by LCE_StatServiceNotifier::setParameters().

+ Here is the caller graph for this function:

◆ setFieldWidth()

void StatServices::setFieldWidth ( unsigned int  val)
inline
153 {_width = val;}

Referenced by LCE_StatServiceNotifier::setParameters().

+ Here is the caller graph for this function:

◆ setOcccurrence()

void StatServices::setOcccurrence ( unsigned int  value)
inline
118 {_occurrence = value;}

◆ setOccurrences()

void StatServices::setOccurrences ( map< unsigned int, unsigned int >  timeTable)

Sets the list of generation for which statistics must be recorded during a run.

Parameters
timeTablea map containing the generations at which stats must be recorded
120 {
121  map<unsigned int, unsigned int>::const_iterator time = timeTable.begin(), next;
122 
123  _occurrences.clear();
124  _occurrences.push_front(0);
125 
126  if (time->first == 0 && time->second != 0) { //this is a recursive logtime
127 
128  unsigned int next_term;
129 
130  for (;time != timeTable.end(); ++time) {
131 
132  next = time;
133  next++;
134  next_term = ( next != timeTable.end() ?
135  next->first : SIMenv::getGenerations() );
136 
137  while( _occurrences.back() + time->second < next_term)
138  {
139  _occurrences.push_back( _occurrences.back() + time->second );
140  }
141  _occurrences.push_back(next_term);
142  }
143 
144 
145  } else if (time->second == 0) { //non-recursive logtime, only records specific times
146 
147  for (;time != timeTable.end(); ++time) _occurrences.push_back(time->first);
148 
149  } else {
150 
151  fatal("something went wrong while setting stat recording times (first=%i, second=%i)\n",
152  time->first, time->second);
153  }
154 
155  //clean up:
156  while (_occurrences.back() > SIMenv::getGenerations()) _occurrences.pop_back();
157 
158  if(_occurrences.back() != SIMenv::getGenerations()) //automatically record last gen
160 
161  if (_occurrences.front() == 0) _occurrences.pop_front();
162  if (_occurrences.front() != 1) _occurrences.push_front(1); //automatically record first gen
163 }
static unsigned int getGenerations()
Definition: simenv.h:59
void fatal(const char *str,...)
Definition: output.cc:98

References fatal(), and SIMenv::getGenerations().

Referenced by LCE_StatServiceNotifier::setOccurence().

+ Here is the caller graph for this function:

◆ setStatOptions()

void StatServices::setStatOptions ( string &  str)
inline
111 {_statArg = str;}

Referenced by LCE_StatServiceNotifier::loadStatServices().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _current_occurrence

list< unsigned int >::const_iterator StatServices::_current_occurrence
private

Iterator pointing to the current generation to record.

Is incremented once all stats have been recorded for the current generation.

◆ _currentStatValues

double* StatServices::_currentStatValues
private

Pointer to the last recorded stats.

◆ _numRecorders

unsigned int StatServices::_numRecorders
private

Number of stats to record.

◆ _occurrence

unsigned int StatServices::_occurrence
private

Deprecated.

◆ _occurrences

list< unsigned int > StatServices::_occurrences
private

List of all generations to record.

◆ _popPtr

Metapop* StatServices::_popPtr
private

◆ _precision

unsigned int StatServices::_precision
private

◆ _printAverages

bool StatServices::_printAverages
private

◆ _separator

unsigned char StatServices::_separator
private

◆ _statArg

string StatServices::_statArg
private

The string argument of the 'stat' input option.

◆ _statHandlers

list< StatHandlerBase* > StatServices::_statHandlers
private

List of stat handlers declared by currently active simulation components.

◆ _statRecorders

list< StatRecBase *> StatServices::_statRecorders
private

List of stat recorders.

◆ _statValues

vector< vector< double*> > StatServices::_statValues
private

Table containing all recorded stats, replicate x generation x (num recorders + 2) .

◆ _width

unsigned int StatServices::_width
private

The documentation for this class was generated from the following files:

Generated for Nemo v2.4.2 by  doxygen 1.9.1

Catalogued on GSR