#include <GLBreederStandard.h>
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) |
Definition at line 23 of file GLBreederStandard.h.
GLBreederStandard::GLBreederStandard | ( | GLBaseCrossover * | crossover, | |
GLBreederStandard::TParameters * | parameters, | |||
GLBaseGeneticAlgorithm * | parent_ga | |||
) |
Constructor. Assigns the crossover which will be used for breeding.
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.
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.
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. |
Implements GLBaseBreeder.
Definition at line 73 of file GLBreederStandard.cpp.