34 #include <selforg/randomgenerator.h>
35 #include <selforg/inspectable.h>
64 Generation(
int generationNumber,
int size,
int numChildren);
161 void update(
double factor = 1.5);
168 bool store(FILE* f)
const;
180 static bool restore(
int numberGeneration, std::map<int,RESTORE_GA_GENERATION*>& generationSet, std::map<
int,std::vector<int> >& linkSet);
266 double m_dNumChildren;
std::vector< Individual * > m_individual
(vector<Individual*>) The storage for the individuals, which are part of this generation.
Definition: Generation.h:193
static bool restore(int numberGeneration, std::map< int, RESTORE_GA_GENERATION * > &generationSet, std::map< int, std::vector< int > > &linkSet)
restore all generation from a restore structure
Definition: Generation.cpp:176
const std::vector< Individual * > & getAllIndividual(void) const
[inline], [const] This function gives all individual back.
Definition: Generation.h:119
virtual ~Generation()
destructor to delete a GenContext.
Definition: Generation.cpp:57
std::string getAllIndividualAsString(void) const
returns a string which represent all individual in this generation.
Definition: Generation.cpp:83
void crossover(RandGen *random)
This function makes an crossOver whit the existing individuals to become from the current size the pl...
Definition: Generation.cpp:61
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
int m_numChildren
(int) The number of children
Definition: Generation.h:205
int getNumChildren(void) const
[inline], [const] This function gives the number of children back, which will be created by crossover...
Definition: Generation.h:101
void update(double factor=1.5)
This function updates the statistical values.
Definition: Generation.cpp:103
void addIndividual(Individual *individual)
This function insert an individual in the generation.
Definition: Generation.cpp:79
int getGenerationNumber(void) const
[inline], [const] This function gives the ID (number) of the generation back.
Definition: Generation.h:77
int getCurrentSize(void) const
[inline], [const] This function gives the actual size (number of individuals inside the generation) b...
Definition: Generation.h:93
int m_size
(int) The planed size of the generation.
Definition: Generation.h:199
std::vector< double > * getAllFitness(void) const
returns all fitness values from the individuals.
Definition: Generation.cpp:93
int getSize(void) const
[inline], [const] This function gives the size which is planed for this generation back...
Definition: Generation.h:85
Interface for inspectable objects.
Definition: inspectable.h:48
int m_generationNumber
(int) The generation number (ID)
Definition: Generation.h:187
The Generation class.
Definition: Generation.h:53
Individual * getIndividual(int x) const
[individual], [const] This function gives one individual from this generation back.
Definition: Generation.h:111
std::vector< Individual * > * getAllUnCalculatedIndividuals(void) const
[inline], [const] This function gives all individual back which aren't have the fitness value calcula...
Definition: Generation.cpp:123
bool store(FILE *f) const
store a generation in a file
Definition: Generation.cpp:134
This class represent one individual of the complete gen.
Definition: Individual.h:45