7 for(uint i = 0; i < nIndividuals_; i++) {
8 this->push_back(
static_cast<IndividualP
> (
new Individual));
9 this->back()->index = (
unsigned int) this->size() - 1;
10 this->back()->initialize(state);
13 hof_ =
static_cast<HallOfFameP
> (
new HallOfFame);
14 hof_->initialize(state);
16 stats_ =
static_cast<StatCalcP
> (
new StatCalc);
17 stats_->initialize(state);
25 newInd->index = index;
26 (*this)[index] = newInd;
31void Deme::write(XMLNode &xDeme)
33 xDeme = XMLNode::createXMLTopNode(
"Deme");
34 std::stringstream value;
35 value << nIndividuals_;
36 xDeme.addAttribute(
"size", value.str().c_str());
43 for(uint i = 0; i < this->size(); i++) {
44 this->at(i)->write(xIndividual);
45 xDeme.addChild(xIndividual);
56 XMLNode xHof = xDeme.getChildNode(0);
57 this->hof_->read(xHof);
59 for(uint i = 0; i < this->size(); i++) {
60 XMLNode xInd = xDeme.getChildNode((
int)i + 1);
61 this->at(i)->read(xInd);
bool replace(uint index, IndividualP newInd)
replace ind. at index with newInd
bool initialize(StateP state)
initialize deme
Records a set of best-so-far individuals.
Individual class - inherits a vector of Genotype objects.
Statistics calculation class.