BALL 1.5.0
Loading...
Searching...
No Matches
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 "geneticIndividual.h"
11
12#include <vector>
13#include <utility>
14#include <random>
15
16namespace BALL
17{
18
19 class DockProblem;
20
21 class DockingAlgorithm;
22
24 {
25 friend class EvolutionaryDocking;
26
27 public:
28 //CREATE(GeneticAlgorithm)
29
33
37
41 int pop_number,
42 int iter,
43 int init,
44 int pop,
45 int surv,
46 double mrate,
47 int save,
48 int citer,
49 double cvalue,
50 int cstart
51 );
52
56
59 virtual GeneticAlgorithm& operator= (const GeneticAlgorithm& ga);
60
63 // virtual GeneticAlgorithm* clone();
64
68 int pop_number,
69 int iter,
70 int init,
71 int pop,
72 int surv,
73 double mrate,
74 int save,
75 int citer,
76 double cvalue,
77 int cstart
78 );
79
82 virtual void start();
83
86 virtual double getValue() { return 0.0; };
87
91
95
96 protected:
97
99
100 vector<GenericParameter*> parameters_;
101
105
108 void mate();
109
112 void mutate();
113
116 void cleanUp();
117
119 void cleanPool(vector<GeneticIndividual>& pool);
120
124
128
132
135 std::vector<std::vector<GeneticIndividual> > pools_;
136
139 std::vector<std::pair<GeneticIndividual*, GeneticIndividual*> > selected_;
140
143 std::vector<double> probabilities_;
144
148
152
156
160
164
168
172
176
178
181 std::mt19937 rng_;
182
186 };
187}
188
189#endif /* BALL_DOCKING_GENETICDOCK_GENETICALGORITHM_H */
GeneticIndividual template_individual_
virtual void start()
std::vector< double > probabilities_
GeneticIndividual * getIndividual(Index i)
DockingAlgorithm * docking_algorithm_
bool registerParameter(GenericParameter *)
vector< GenericParameter * > parameters_
void cleanPool(vector< GeneticIndividual > &pool)
GeneticAlgorithm(const GeneticAlgorithm &ga)
double calculate(GeneticIndividual *)
void setup(DockProblem *, int pop_number, int iter, int init, int pop, int surv, double mrate, int save, int citer, double cvalue, int cstart)
std::vector< std::pair< GeneticIndividual *, GeneticIndividual * > > selected_
GeneticAlgorithm(DockingAlgorithm *docker, DockProblem *, int pop_number, int iter, int init, int pop, int surv, double mrate, int save, int citer, double cvalue, int cstart)
virtual double getValue()
std::vector< std::vector< GeneticIndividual > > pools_
#define BALL_DEPRECATED
#define BALL_EXPORT