Nemo  2.4.0
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
99  { }
Metapop * _popPtr
Definition: statservices.h:53
unsigned char _separator
Definition: statservices.h:87
unsigned int _occurrence
Deprecated.
Definition: statservices.h:74
unsigned int _width
Definition: statservices.h:85
unsigned int _precision
Definition: statservices.h:85
unsigned int _numRecorders
Number of stats to record.
Definition: statservices.h:62
bool _printAverages
Definition: statservices.h:89
double * _currentStatValues
Pointer to the last recorded stats.
Definition: statservices.h:68

◆ ~StatServices()

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

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.

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

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
142 {_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
183  {
184  assert( _statValues[ replicate-1 ].size() < _occurrences.size() );
185 
186  assert( size == _numRecorders+2);
187 
188  double* new_record = new double[size];
189 
190  memcpy(new_record, values, size*sizeof(double));
191 
192  _statValues[ replicate-1 ].push_back(new_record);
193  }
list< unsigned int > _occurrences
List of all generations to record.
Definition: statservices.h:77
vector< vector< double * > > _statValues
Table containing all recorded stats, replicate x generation x (num recorders + 2) .
Definition: statservices.h:65

◆ doPrintAverages()

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

Referenced by LCE_StatServiceNotifier::loadStatServices().

+ Here is the caller graph for this function:

◆ get_pop_ptr()

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

Referenced by StatHandlerBase::get_pop_ptr().

+ Here is the caller graph for this function:

◆ getAllStats()

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

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.

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

Referenced by StatHandlerBase::getCurrentOccurrence().

+ Here is the caller graph for this function:

◆ getFirst()

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

◆ getGenerationStatValues()

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

◆ getLast()

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

◆ getNumOccurrences() [1/2]

unsigned int StatServices::getNumOccurrences ( )
inline

Returns the maximum number of generation records per replicate.

125 {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).
131  {
132  return _statValues[replicate-1].size();
133  }

◆ getNumStats()

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

◆ getOccurrence()

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

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

+ Here is the caller graph for this function:

◆ getPrintAveragesOpt()

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

Referenced by LCE_StatFH::FHwrite().

+ Here is the caller graph for this function:

◆ getReplicateStatRecords()

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

◆ getStatArg()

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

◆ init()

bool StatServices::init ( )
virtual

Implements Service.

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

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.

170 {
171  sc->loadStatServices(this);
172 }
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.

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

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

Referenced by LCE_StatServiceNotifier::execute().

+ Here is the caller graph for this function:

◆ printStatAverage()

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

References SIMenv::getReplicates().

Referenced by LCE_StatFH::PrintStat_byGen().

+ Here is the caller graph for this function:

◆ printStatHeaders()

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

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

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.

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

References SIMenv::getCurrentReplicate().

◆ reset()

void StatServices::reset ( )
virtual

clear the list of StatHandler

Implements Service.

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

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.

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

◆ 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
110  {_statArg = str; _occurrence = occ;}

◆ set_pop_ptr()

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

Referenced by SimRunner::init_components().

+ Here is the caller graph for this function:

◆ setCompactOutputFormat()

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

Referenced by LCE_StatServiceNotifier::setParameters().

+ Here is the caller graph for this function:

◆ setDefaultOutputFormat()

void StatServices::setDefaultOutputFormat ( )
inline
160 {_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
156 {_precision = val;}

Referenced by LCE_StatServiceNotifier::setParameters().

+ Here is the caller graph for this function:

◆ setFieldSeparator()

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

Referenced by LCE_StatServiceNotifier::setParameters().

+ Here is the caller graph for this function:

◆ setFieldWidth()

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

Referenced by LCE_StatServiceNotifier::setParameters().

+ Here is the caller graph for this function:

◆ setOcccurrence()

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

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
112 {_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.0 by  doxygen 1.9.1 -- Nemo is hosted on  Download Nemo

Locations of visitors to this page
Catalogued on GSR