#include <GLBaseVariator.h>
Public Member Functions | |
GLBaseVariator (GLBaseMutator *mutator) | |
virtual | ~GLBaseVariator () |
virtual int | applyMutator (GLBasePopulation *population, GLBaseOrganismStorage *organisms, GLBaseOrganismStorage *mutants, GLConstants::TStorageFilling fill=GLConstants::APPEND, GLConstants::TTwinsFlags twins=GLConstants::NO_TWINS, int max_mutants=-1)=0 |
GLBaseMutator * | getMutator () |
const GLBaseMutator * | getMutator () const |
virtual void | reset () |
Protected Attributes | |
GLBaseMutator * | m_mutator |
mutation operator. Gets destroyed with this class. |
Definition at line 18 of file GLBaseVariator.h.
GLBaseVariator::GLBaseVariator | ( | GLBaseMutator * | mutator | ) |
Constructor. Takes the pointer to mutator operator.
mutator | mutator operator. |
Definition at line 9 of file GLBaseVariator.cpp.
GLBaseVariator::~GLBaseVariator | ( | ) | [virtual] |
Deletes all, including mutator operator. s
Deletes all, including mutator operator.
Definition at line 18 of file GLBaseVariator.cpp.
virtual int GLBaseVariator::applyMutator | ( | GLBasePopulation * | population, | |
GLBaseOrganismStorage * | organisms, | |||
GLBaseOrganismStorage * | mutants, | |||
GLConstants::TStorageFilling | fill = GLConstants::APPEND , |
|||
GLConstants::TTwinsFlags | twins = GLConstants::NO_TWINS , |
|||
int | max_mutants = -1 | |||
) | [pure virtual] |
Applies mutator to the set container of organisms.
population | population to which mutated organisms belong -- mainly to check for uniqueness of the mutants. | |
organisms | container with organisms. | |
mutants | where mutated organisms will be added. | |
fill | when equal to APPEND the container with mutants will be appended with new organisms, when REPLACE - mutants will be emptied at the beginning. | |
twins | when NO_TWINS only unique organisms will be added. | |
max_mutants | maximum number of mutants to be created, if < 0 -- number is limited only by the mutation algorithm used. |
Implemented in GLVariatorStandard.
const GLBaseMutator* GLBaseVariator::getMutator | ( | ) | const [inline] |
Returns the mutator associated with this variator.
Definition at line 67 of file GLBaseVariator.h.
GLBaseMutator* GLBaseVariator::getMutator | ( | ) | [inline] |
Returns the mutator associated with this variator.
Definition at line 60 of file GLBaseVariator.h.
void GLBaseVariator::reset | ( | ) | [virtual] |
Resets the variator (e.g. sets counter, if any, to zero etc.) and its mutator.
Definition at line 31 of file GLBaseVariator.cpp.