GLBreederStandard Class Reference

#include <GLBreederStandard.h>

Inheritance diagram for GLBreederStandard:

GLBaseBreeder

List of all members.

Classes

struct  TParameters

Public Member Functions

 GLBreederStandard (GLBaseCrossover *crossover, GLBreederStandard::TParameters *parameters, GLBaseGeneticAlgorithm *parent_ga)
virtual ~GLBreederStandard ()
virtual int breedOrganisms (GLBasePopulation *population, GLBaseOrganismStorage *potential_parents, GLBaseOrganismStorage *offsprings, GLConstants::TStorageFilling fill=GLConstants::APPEND, GLConstants::TTwinsFlags twins=GLConstants::NO_TWINS, int size_limits=-1)


Detailed Description

Standard breed algorithm -- ranks all the organisms according to value of the fitness function. Then, starting from the best organism, applies crossover with given probability to all of the organisms ranked below (considers each possible pair and then randomly decides when to apply crossover), then do the same starting with the second best organism etc. until the required number of organisms was generated. In this way the higher organism is ranked the more chances it will have to produce offsprings. This class cannot exist without parent GA, as it uses evaluator and ranker from there,

Definition at line 23 of file GLBreederStandard.h.


Constructor & Destructor Documentation

GLBreederStandard::GLBreederStandard ( GLBaseCrossover crossover,
GLBreederStandard::TParameters parameters,
GLBaseGeneticAlgorithm parent_ga 
)

Constructor. Assigns the crossover which will be used for breeding.

Parameters:
crossover crossover which will be used for breeding.
parameters structure which contains the breeding probability parameter (probability of applying the crossover operator to any considered pair, must be >= 0 and <= 1).
parent_ga genetic algorithm which owns the exemplar of this class. Will provide the means to use the evaluator and ranker from the GA.

Definition at line 29 of file GLBreederStandard.cpp.

GLBreederStandard::~GLBreederStandard (  )  [virtual]

Destructor, destroys everything, including crossover.

Definition at line 52 of file GLBreederStandard.cpp.


Member Function Documentation

int GLBreederStandard::breedOrganisms ( GLBasePopulation population,
GLBaseOrganismStorage potential_parents,
GLBaseOrganismStorage offsprings,
GLConstants::TStorageFilling  fill = GLConstants::APPEND,
GLConstants::TTwinsFlags  twins = GLConstants::NO_TWINS,
int  size_limits = -1 
) [virtual]

Breeds organisms -- produces the offsprings from parents based on certain criteria using the crossover owned by this breeder.

Parameters:
population population to which parents belong -- mainly to be able to check the uniqueness of the new offsprings.
potential_parents organisms to be bred.
offsprings storage place to store the children.
fill when APPEND adds the organisms to the storage, when REPLACE the storage is emptied at the beginning.
twins when NO_TWINS all the offsprings will be checked for uniqueness with the parent's population before being added to the storage of offsprings.
size_limits limit number of produced offsprings. When < 0 all the offsprings generated by the algorithm will be returned.
Returns:
number of offsprings produced.

Implements GLBaseBreeder.

Definition at line 73 of file GLBreederStandard.cpp.


The documentation for this class was generated from the following files:

Generated on Sat Jun 13 13:58:07 2009 for GenLib by  doxygen 1.5.9