GPLIB++
GeneralPropagation.h
Go to the documentation of this file.
1 #ifndef CGENERALPROPAGATION_H
2 #define CGENERALPROPAGATION_H
3 #include "GeneralSelect.h"
4 #include "GeneralPopulation.h"
5 #include "GeneralRNG.h"
6 namespace gplib
7  {
8  /** \addtogroup gainv Genetic algorithm optimization */
9  /* @{ */
10 
11  //! The base class for genetic algorithm propagation methods
12  /*! This class defines the common functionality that is necessary
13  * to generate a new population from the current generation. The implementation
14  * details depend on the type of GA and Population encoding and those classes
15  * have to match to do anything useful.
16  */
18  {
19  protected:
20  virtual void Crossover(tpopmember &father, tpopmember &mother);
21  virtual void Mutation(tpopmember &child);
25  double MutationProb;
26  double CrossoverProb;
27  public:
28  virtual void NextGeneration() = 0;
29  void SetParams(const double mutation, const double crossover)
30  {
31  MutationProb = mutation;
32  CrossoverProb = crossover;
33  }
34  ;
35  GeneralPropagation(GeneralSelect* const LocalSelect,
36  GeneralPopulation* const LocalPopulation,
37  GeneralRNG* const LocalRandom);
38  virtual ~GeneralPropagation();
40  };
41  /* @} */
42  }
43 #endif // CGENERALPROPAGATION_H
The base class for the population of a genetic algorithm, implements storage and access functions...
GeneralPropagation(GeneralSelect *const LocalSelect, GeneralPopulation *const LocalPopulation, GeneralRNG *const LocalRandom)
GeneralSelect is the abstract base class for any selection mechanism in genetic algorithms.
Definition: GeneralSelect.h:16
The base class for genetic algorithm propagation methods.
void SetParams(const double mutation, const double crossover)
virtual void Mutation(tpopmember &child)
ublas::vector< bool > tpopmember
Definition: gentypes.h:22
GeneralPopulation *const Population
virtual void Crossover(tpopmember &father, tpopmember &mother)
GeneralSelect *const Select
The base class for all random number generators, defines the basic interface.
Definition: GeneralRNG.h:9
virtual void NextGeneration()=0