ECF 1.5
Population.h
1#ifndef Population_h
2#define Population_h
3
4#include "Deme.h"
5
14class Population : public std::vector <DemeP>
15{
16protected:
17 uint nDemes_;
20 StateP state_;
21 HallOfFameP hof_;
22 StatCalcP stats_;
23
24public:
25 Population();
26 bool initialize(StateP state);
27 void registerParameters(StateP state);
28 void write(XMLNode&);
29 void read(XMLNode&);
30 void updateDemeStats();
31 uint getNoDemes()
32 { return nDemes_; }
34 { return myDemeIndex_; }
35 DemeP getLocalDeme()
36 { return this->at(0); }
37 HallOfFameP getHof()
38 { return hof_; }
39 StatCalcP getStats()
40 { return stats_; }
41};
42typedef boost::shared_ptr<Population> PopulationP;
43
44#endif // Population_h
45
Population class - inherits a vector of Deme objects.
Definition: Population.h:15
DemeP getLocalDeme()
get first deme (local deme in parallel ECF)
Definition: Population.h:35
void read(XMLNode &)
Read population from XMLNode (serial ECF). Population must be initialize()-d beforehand!
Definition: Population.cpp:65
uint myDemeIndex_
global index of local deme (at local process) - PECF only
Definition: Population.h:18
uint nDemes_
total number of demes in the population
Definition: Population.h:17
uint getLocalDemeId()
return local deme index (local process in parallel ECF)
Definition: Population.h:33
StatCalcP getStats()
get population stats
Definition: Population.h:39
StatCalcP stats_
population statistics
Definition: Population.h:22
bool initialize(StateP state)
Initialize population (serial ECF).
Definition: Population.cpp:35
uint nIndividuals_
number of individuals (in each deme!)
Definition: Population.h:19
void write(XMLNode &)
Write population to XMLNode (serial ECF).
Definition: Population.cpp:80
void registerParameters(StateP state)
register population specific parameters
Definition: Population.cpp:16
void updateDemeStats()
Update, gather and write statistics of all demes; update and gather HallOfFame of all demes.
Definition: Population.cpp:100
uint getNoDemes()
return total number of demes
Definition: Population.h:31
HallOfFameP getHof()
get population HallofFame
Definition: Population.h:37
HallOfFameP hof_
population HallOfFame
Definition: Population.h:21