BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
geneticAlgorithm.h
Go to the documentation of this file.
1 // ----------------------------------------------------
2 // $Maintainer: Marcel Schumann $
3 // $Authors: Jan Fuhrmann, Marcel Schumann $
4 // ----------------------------------------------------
5 
6 #ifndef BALL_DOCKING_GENETICDOCK_GENETICALGORITHM_H
7 #define BALL_DOCKING_GENETICDOCK_GENETICALGORITHM_H
8 
9 #include <vector>
11 #include <utility>
12 #include "geneticIndividual.h"
14 
15 namespace BALL
16 {
17 
18  class DockProblem;
19  class DockingAlgorithm;
20 
22  {
23 
24  friend class EvolutionaryDocking;
25 
26  public:
27  //CREATE(GeneticAlgorithm)
28 
32 
36 
40  int pop_number,
41  int iter,
42  int init,
43  int pop,
44  int surv,
45  double mrate,
46  int save,
47  int citer,
48  double cvalue,
49  int cstart );
50 
53  virtual ~GeneticAlgorithm();
54 
57  virtual GeneticAlgorithm& operator = (const GeneticAlgorithm& ga);
58 
61  // virtual GeneticAlgorithm* clone();
62 
65  void setup(DockProblem*,
66  int pop_number,
67  int iter,
68  int init,
69  int pop,
70  int surv,
71  double mrate,
72  int save,
73  int citer,
74  double cvalue,
75  int cstart);
76 
79  virtual void start();
80 
83  virtual double getValue() { return 0.0;};
84 
87  GeneticIndividual* getIndividual(Index i);
88 
91  bool registerParameter(GenericParameter*);
92 
93  protected:
94 
95  double calculate(GeneticIndividual*);
96 
97  vector<GenericParameter*> parameters_;
98 
101  void select(Size);
102 
105  void mate();
106 
109  void mutate();
110 
113  void cleanUp();
114 
116  void cleanPool(vector<GeneticIndividual>& pool);
117 
120  bool multiDemeCheck();
121 
124  void updatePool();
125 
129 
132  std::vector<std::vector<GeneticIndividual> > pools_;
133 
136  std::vector<std::pair<GeneticIndividual*, GeneticIndividual*> > selected_;
137 
140  std::vector<double> probabilities_;
141 
145 
149 
153 
157 
161 
165 
169 
172  bool finished_;
173 
175 
179 
183 
184  };
185 }
186 
187 #endif /* BALL_DOCKING_GENETICDOCK_GENETICALGORITHM_H */
virtual double getValue()
std::vector< std::vector< GeneticIndividual > > pools_
std::vector< double > probabilities_
RandomNumberGenerator rng_
std::vector< std::pair< GeneticIndividual *, GeneticIndividual * > > selected_
vector< GenericParameter * > parameters_
GeneticIndividual template_individual_
DockingAlgorithm * docking_algorithm_
#define BALL_EXPORT
Definition: COMMON/global.h:50