Loading...
Searching...
No Matches
geneticAlgorithm.h
Go to the documentation of this file.
// ----------------------------------------------------
// $Maintainer: Marcel Schumann $
// $Authors: Jan Fuhrmann, Marcel Schumann $
// ----------------------------------------------------
#ifndef BALL_DOCKING_GENETICDOCK_GENETICALGORITHM_H
#define BALL_DOCKING_GENETICDOCK_GENETICALGORITHM_H
#include "geneticIndividual.h"
#include <BALL/DOCKING/GENETICDOCK/parameter.h>
#include <vector>
#include <utility>
#include <random>
namespace BALL
{
class DockProblem;
class DockingAlgorithm;
class BALL_EXPORT BALL_DEPRECATED GeneticAlgorithm
{
friend class EvolutionaryDocking;
public:
//CREATE(GeneticAlgorithm)
GeneticAlgorithm();
GeneticAlgorithm(const GeneticAlgorithm& ga);
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 ~GeneticAlgorithm();
virtual GeneticAlgorithm& operator= (const GeneticAlgorithm& ga);
// virtual GeneticAlgorithm* clone();
void setup(DockProblem*,
int pop_number,
int iter,
int init,
int pop,
int surv,
double mrate,
int save,
int citer,
double cvalue,
int cstart
);
virtual void start();
virtual double getValue() { return 0.0; };
GeneticIndividual* getIndividual(Index i);
bool registerParameter(GenericParameter*);
protected:
double calculate(GeneticIndividual*);
vector<GenericParameter*> parameters_;
void select(Size);
void mate();
void mutate();
void cleanUp();
void cleanPool(vector<GeneticIndividual>& pool);
bool multiDemeCheck();
void updatePool();
Size population_size_;
std::vector<std::vector<GeneticIndividual> > pools_;
std::vector<std::pair<GeneticIndividual*, GeneticIndividual*> > selected_;
std::vector<double> probabilities_;
DockProblem* gp_;
Size max_iterations_;
Size immune_;
double mutation_rate_;
Size iteration_;
Size survivors_;
int conv_start_;
bool finished_;
DockingAlgorithm* docking_algorithm_;
std::mt19937 rng_;
GeneticIndividual template_individual_;
};
}
#endif /* BALL_DOCKING_GENETICDOCK_GENETICALGORITHM_H */
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition COMMON/global.h:64
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::DockProblem
Definition dockProblem.h:36
BALL::DockingAlgorithm
Definition dockingAlgorithm.h:46
BALL::GenericParameter
Definition parameter.h:15
BALL::GeneticAlgorithm::immune_
Size immune_
Definition geneticAlgorithm.h:155
BALL::GeneticAlgorithm::mate
void mate()
BALL::GeneticAlgorithm::template_individual_
GeneticIndividual template_individual_
Definition geneticAlgorithm.h:185
BALL::GeneticAlgorithm::start
virtual void start()
BALL::GeneticAlgorithm::multiDemeCheck
bool multiDemeCheck()
BALL::GeneticAlgorithm::finished_
bool finished_
Definition geneticAlgorithm.h:175
BALL::GeneticAlgorithm::iteration_
Size iteration_
Definition geneticAlgorithm.h:163
BALL::GeneticAlgorithm::cleanUp
void cleanUp()
BALL::GeneticAlgorithm::EvolutionaryDocking
friend class EvolutionaryDocking
Definition geneticAlgorithm.h:25
BALL::GeneticAlgorithm::probabilities_
std::vector< double > probabilities_
Definition geneticAlgorithm.h:143
BALL::GeneticAlgorithm::getIndividual
GeneticIndividual * getIndividual(Index i)
BALL::GeneticAlgorithm::mutation_rate_
double mutation_rate_
Definition geneticAlgorithm.h:159
BALL::GeneticAlgorithm::docking_algorithm_
DockingAlgorithm * docking_algorithm_
Definition geneticAlgorithm.h:177
BALL::GeneticAlgorithm::registerParameter
bool registerParameter(GenericParameter *)
BALL::GeneticAlgorithm::population_size_
Size population_size_
Definition geneticAlgorithm.h:131
BALL::GeneticAlgorithm::parameters_
vector< GenericParameter * > parameters_
Definition geneticAlgorithm.h:100
BALL::GeneticAlgorithm::cleanPool
void cleanPool(vector< GeneticIndividual > &pool)
BALL::GeneticAlgorithm::GeneticAlgorithm
GeneticAlgorithm(const GeneticAlgorithm &ga)
BALL::GeneticAlgorithm::rng_
std::mt19937 rng_
Definition geneticAlgorithm.h:181
BALL::GeneticAlgorithm::select
void select(Size)
BALL::GeneticAlgorithm::gp_
DockProblem * gp_
Definition geneticAlgorithm.h:147
BALL::GeneticAlgorithm::calculate
double calculate(GeneticIndividual *)
BALL::GeneticAlgorithm::setup
void setup(DockProblem *, int pop_number, int iter, int init, int pop, int surv, double mrate, int save, int citer, double cvalue, int cstart)
BALL::GeneticAlgorithm::conv_start_
int conv_start_
Definition geneticAlgorithm.h:171
BALL::GeneticAlgorithm::selected_
std::vector< std::pair< GeneticIndividual *, GeneticIndividual * > > selected_
Definition geneticAlgorithm.h:139
BALL::GeneticAlgorithm::GeneticAlgorithm
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)
BALL::GeneticAlgorithm::~GeneticAlgorithm
virtual ~GeneticAlgorithm()
BALL::GeneticAlgorithm::getValue
virtual double getValue()
Definition geneticAlgorithm.h:86
BALL::GeneticAlgorithm::pools_
std::vector< std::vector< GeneticIndividual > > pools_
Definition geneticAlgorithm.h:135
BALL::GeneticAlgorithm::mutate
void mutate()
BALL::GeneticAlgorithm::survivors_
Size survivors_
Definition geneticAlgorithm.h:167
BALL::GeneticAlgorithm::updatePool
void updatePool()
BALL::GeneticAlgorithm::max_iterations_
Size max_iterations_
Definition geneticAlgorithm.h:151
BALL::GeneticAlgorithm::GeneticAlgorithm
GeneticAlgorithm()
BALL::GeneticIndividual
Definition geneticIndividual.h:16
geneticIndividual.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
parameter.h