ECF 1.7
Individual.h
1#ifndef Individual_h
2#define Individual_h
3
4#include "Genotype.h"
5#include "Fitness.h"
6
11class Individual : public std::vector <GenotypeP>
12{
13protected:
14 StateP state_;
15
16public:
17 Individual()
18 {
19 cid = 0;
20 }
21
22 Individual(StateP state);
23
24 bool initialize(StateP state);
25
26 void write(XMLNode&);
27
28 void read(XMLNode&);
29
30 std::string toString();
31
32 Individual* copy();
33
34 GenotypeP getGenotype(uint index = 0);
35
36 FitnessP getFitness();
37
38 FitnessP fitness;
39
40 uint index;
41
42 uint cid;
43};
44typedef std::shared_ptr<Individual> IndividualP;
45
46#endif // Individual_h
47
FitnessP getFitness()
return sptr to individual's fitness object
uint cid
coherence index, used in asynchronous parallel algoritmhs
Definition Individual.h:42
GenotypeP getGenotype(uint index=0)
return genotype with given index
void write(XMLNode &)
write individual to XML node
void read(XMLNode &)
read individual from XML node
bool initialize(StateP state)
initialize individual
std::string toString()
output individual to string
FitnessP fitness
sptr to individual's fitness object
Definition Individual.h:38
uint index
individual's index in Deme
Definition Individual.h:40
Individual * copy()
create a copy of the individual