In file code/C/generation.H:
class GGeneration : public GObject
This class performs the actual genetic evolution of the
programs.
Inheritance:
public members:
-
GGeneration()
-
~GGeneration()
-
void GenerateNewGeneration(int gen_size, int min_depth, int max_depth, int head_type=-1)
- Create a random set of programs and evaluate them
void BreedNewGeneration(int num_progs, int prob_cross, int prob_mutate, int prob_select)
- Breed the ``successful'' programs and evaluate the new ones
void Rank( GArray < GProgFit > &ranks)
- Return the ranking of the programs
int GetGeneration()
- Return the current generation
void AddModel( GModel *new_model)
- Add model to the model list to use in evaluation
GProgram *GetProgram(int prog_num)
- Get the specified program root
int GetNumProgs()
- Get the number of programs that exist
private members:
-
int generation_num
- The current generation (0 is first)
GArray < GProgram > programs
- The generated programs
GArray < GProgram > new_programs
- The evolving programs
GArray < GModel > models
- The list of models used to evaluate
int stored_min_depth
- The minimum depth of a new tree
int stored_max_depth
- The maximum depth of a new tree
double most_bad
- The worst program we have seen
int GetSize(int type, GOperator *node)
- Returns the size of the tree beneath the given node
int GetNode(int type, int *num, GOperator *node, GOperator **parent, int *entry)
- Finds a node that matches the given criteria
GOperator *make_new_program(int min_depth, int max_depth, int cur_depth, int head_type, type_enum ret_type = TYPE_INVALID)
- Generates a new program
void Crossover(int prog_id1, int prog_id2)
- Perform the crossover operation on the given program indeces
void Mutate(int prog_id1)
- Mutate the given program
void Select(int prog_id1)
- Select(copy) the given program
void EvaluateGeneration()
- Evaluate the current generation with all of the models
public members:
-
friend ostream& operator<<(ostream& s, GObject &)
Documentation
This class holds all the information about a particular
generation of programs and contains functions to evaluate, mutate
and report on the programs.
this class has no child classes.
alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling