Loading...
Searching...
No Matches
BALL::GeneticAlgorithm Class Reference

`#include <BALL/DOCKING/GENETICDOCK/geneticAlgorithm.h>`

## Public Member Functions

| 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)
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 ()
GeneticIndividual * | getIndividual (Index i)
bool | registerParameter (GenericParameter *)

## Protected Member Functions

double | calculate (GeneticIndividual *)
void | select (Size)
void | mate ()
void | mutate ()
void | cleanUp ()
void | cleanPool (vector< GeneticIndividual > &pool)
bool | multiDemeCheck ()
void | updatePool ()

## Protected Attributes

vector< GenericParameter * > | parameters_
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_

## Friends

class | EvolutionaryDocking

## Detailed Description

Definition at line 23 of file geneticAlgorithm.h.

## Constructor & Destructor Documentation

## GeneticAlgorithm() [1/3]

BALL::GeneticAlgorithm::GeneticAlgorithm | ( |  | ) |

default constructor

## GeneticAlgorithm() [2/3]

BALL::GeneticAlgorithm::GeneticAlgorithm | ( | const GeneticAlgorithm & | ga | ) |

copy constructor

## GeneticAlgorithm() [3/3]

BALL::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 )

constructor

## ~GeneticAlgorithm()

virtual BALL::GeneticAlgorithm::~GeneticAlgorithm | ( |  | ) |

virtual

default destructor

## Member Function Documentation

## calculate()

double BALL::GeneticAlgorithm::calculate | ( | GeneticIndividual * |  | ) |

protected

## cleanPool()

void BALL::GeneticAlgorithm::cleanPool | ( | vector< GeneticIndividual > & | pool | ) |

protected

sorts the given pool according to the fitness values of its members and keeps only the best survivors_>ones (#best ones = survivors_)

## cleanUp()

void BALL::GeneticAlgorithm::cleanUp | ( |  | ) |

protected

discard individuals

## getIndividual()

GeneticIndividual * BALL::GeneticAlgorithm::getIndividual | ( | Index | i | ) |

get i-th individual?!?!?

## getValue()

virtual double BALL::GeneticAlgorithm::getValue | ( |  | ) |

inline virtual

Definition at line 86 of file geneticAlgorithm.h.

## mate()

void BALL::GeneticAlgorithm::mate | ( |  | ) |

protected

produce offsprings

## multiDemeCheck()

bool BALL::GeneticAlgorithm::multiDemeCheck | ( |  | ) |

protected

check for migration between populations

## mutate()

void BALL::GeneticAlgorithm::mutate | ( |  | ) |

protected

random alteration

## operator=()

virtual GeneticAlgorithm & BALL::GeneticAlgorithm::operator= | ( | const GeneticAlgorithm & | ga | ) |

virtual

assignment operator

## registerParameter()

bool BALL::GeneticAlgorithm::registerParameter | ( | GenericParameter * |  | ) |

register a parameter for optimization

## select()

void BALL::GeneticAlgorithm::select | ( | Size |  | ) |

protected

select individuals for mating

## setup()

void BALL::GeneticAlgorithm::setup | ( | DockProblem * | ,
|  | int | pop_number,
|  | int | iter,
|  | int | init,
|  | int | pop,
|  | int | surv,
|  | double | mrate,
|  | int | save,
|  | int | citer,
|  | double | cvalue,
|  | int | cstart )

clone method setup method

## start()

virtual void BALL::GeneticAlgorithm::start | ( |  | ) |

virtual

optimize pool

## updatePool()

void BALL::GeneticAlgorithm::updatePool | ( |  | ) |

protected

assign fitness score

## Friends And Related Symbol Documentation

## EvolutionaryDocking

friend class EvolutionaryDocking

friend

Definition at line 25 of file geneticAlgorithm.h.

## Member Data Documentation

## conv_start_

int BALL::GeneticAlgorithm::conv_start_

protected

iteration for the first convergence test

Definition at line 171 of file geneticAlgorithm.h.

## docking_algorithm_

DockingAlgorithm* BALL::GeneticAlgorithm::docking_algorithm_

protected

Definition at line 177 of file geneticAlgorithm.h.

## finished_

bool BALL::GeneticAlgorithm::finished_

protected

true if algorithm has stopped

Definition at line 175 of file geneticAlgorithm.h.

## gp_

DockProblem* BALL::GeneticAlgorithm::gp_

protected

assings fitness score to individuals

Definition at line 147 of file geneticAlgorithm.h.

## immune_

Size BALL::GeneticAlgorithm::immune_

protected

number of individuals immune to mutation

Definition at line 155 of file geneticAlgorithm.h.

## iteration_

Size BALL::GeneticAlgorithm::iteration_

protected

count iterations during optimizaton

Definition at line 163 of file geneticAlgorithm.h.

## max_iterations_

Size BALL::GeneticAlgorithm::max_iterations_

protected

number of iterations

Definition at line 151 of file geneticAlgorithm.h.

## mutation_rate_

double BALL::GeneticAlgorithm::mutation_rate_

protected

fraction of individuals to be mutated

Definition at line 159 of file geneticAlgorithm.h.

## parameters_

vector<GenericParameter*> BALL::GeneticAlgorithm::parameters_

protected

Definition at line 100 of file geneticAlgorithm.h.

## pools_

std::vector<std::vector<GeneticIndividual> > BALL::GeneticAlgorithm::pools_

protected

vector of populations

Definition at line 135 of file geneticAlgorithm.h.

## population_size_

Size BALL::GeneticAlgorithm::population_size_

protected

size of one population

Definition at line 131 of file geneticAlgorithm.h.

## probabilities_

std::vector<double> BALL::GeneticAlgorithm::probabilities_

protected

probabilities for rank weighting

Definition at line 143 of file geneticAlgorithm.h.

## rng_

std::mt19937 BALL::GeneticAlgorithm::rng_

protected

RNG engine

Definition at line 181 of file geneticAlgorithm.h.

## selected_

std::vector<std::pair<GeneticIndividual*, GeneticIndividual*> > BALL::GeneticAlgorithm::selected_

protected

vector of selected individuals

Definition at line 139 of file geneticAlgorithm.h.

## survivors_

Size BALL::GeneticAlgorithm::survivors_

protected

number of individuals surviving an iteration

Definition at line 167 of file geneticAlgorithm.h.

## template_individual_

GeneticIndividual BALL::GeneticAlgorithm::template_individual_

protected

used to initialize new individuals

Definition at line 185 of file geneticAlgorithm.h.