BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
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 GeneticAlgorithmoperator= (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 ()
 
GeneticIndividualgetIndividual (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< doubleprobabilities_
 
DockProblemgp_
 
Size max_iterations_
 
Size immune_
 
double mutation_rate_
 
Size iteration_
 
Size survivors_
 
int conv_start_
 
bool finished_
 
DockingAlgorithmdocking_algorithm_
 
RandomNumberGenerator rng_
 
GeneticIndividual template_individual_
 

Friends

class EvolutionaryDocking
 

Detailed Description

Definition at line 21 of file geneticAlgorithm.h.

Constructor & Destructor Documentation

BALL::GeneticAlgorithm::GeneticAlgorithm ( )

default constructor

BALL::GeneticAlgorithm::GeneticAlgorithm ( const GeneticAlgorithm ga)

copy constructor

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

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

default destructor

Member Function Documentation

double BALL::GeneticAlgorithm::calculate ( GeneticIndividual )
protected
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_)

void BALL::GeneticAlgorithm::cleanUp ( )
protected

discard individuals

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

get i-th individual?!?!?

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

Definition at line 83 of file geneticAlgorithm.h.

void BALL::GeneticAlgorithm::mate ( )
protected

produce offsprings

bool BALL::GeneticAlgorithm::multiDemeCheck ( )
protected

check for migration between populations

void BALL::GeneticAlgorithm::mutate ( )
protected

random alteration

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

assignment operator

bool BALL::GeneticAlgorithm::registerParameter ( GenericParameter )

register a parameter for optimization

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

select individuals for mating

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 methodsetup method

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

optimize pool

void BALL::GeneticAlgorithm::updatePool ( )
protected

assign fitness score

Friends And Related Function Documentation

friend class EvolutionaryDocking
friend

Definition at line 24 of file geneticAlgorithm.h.

Member Data Documentation

int BALL::GeneticAlgorithm::conv_start_
protected

iteration for the first convergence test

Definition at line 168 of file geneticAlgorithm.h.

DockingAlgorithm* BALL::GeneticAlgorithm::docking_algorithm_
protected

Definition at line 174 of file geneticAlgorithm.h.

bool BALL::GeneticAlgorithm::finished_
protected

true if algorithm has stopped

Definition at line 172 of file geneticAlgorithm.h.

DockProblem* BALL::GeneticAlgorithm::gp_
protected

assings fitness score to individuals

Definition at line 144 of file geneticAlgorithm.h.

Size BALL::GeneticAlgorithm::immune_
protected

number of individuals immune to mutation

Definition at line 152 of file geneticAlgorithm.h.

Size BALL::GeneticAlgorithm::iteration_
protected

count iterations during optimizaton

Definition at line 160 of file geneticAlgorithm.h.

Size BALL::GeneticAlgorithm::max_iterations_
protected

number of iterations

Definition at line 148 of file geneticAlgorithm.h.

double BALL::GeneticAlgorithm::mutation_rate_
protected

fraction of individuals to be mutated

Definition at line 156 of file geneticAlgorithm.h.

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

Definition at line 97 of file geneticAlgorithm.h.

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

vector of populations

Definition at line 132 of file geneticAlgorithm.h.

Size BALL::GeneticAlgorithm::population_size_
protected

size of one population

Definition at line 128 of file geneticAlgorithm.h.

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

probabilities for rank weighting

Definition at line 140 of file geneticAlgorithm.h.

RandomNumberGenerator BALL::GeneticAlgorithm::rng_
protected

Definition at line 178 of file geneticAlgorithm.h.

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

vector of selected individuals

Definition at line 136 of file geneticAlgorithm.h.

Size BALL::GeneticAlgorithm::survivors_
protected

number of individuals surviving an iteration

Definition at line 164 of file geneticAlgorithm.h.

GeneticIndividual BALL::GeneticAlgorithm::template_individual_
protected

used to initialize new individuals

Definition at line 182 of file geneticAlgorithm.h.