#include <GLBaseMutator.h>
Public Member Functions | |
GLBaseMutator (double mutation_rate=0.5, bool check_range=false) | |
GLBaseMutator (const GLBaseMutator &mutator) | |
virtual | ~GLBaseMutator () |
virtual GLBaseMutator * | copy () const =0 |
double | getMutationRate () const |
virtual bool | mutateOrganism (GLBaseOrganism *organism)=0 |
virtual void | reset () |
void | setMutationRate (double mutation_rate, bool checkRange=false) |
Definition at line 9 of file GLBaseMutator.h.
GLBaseMutator::GLBaseMutator | ( | double | mutation_rate = 0.5 , |
|
bool | check_range = false | |||
) | [inline] |
Creates the base mutator.
mutation_rate | rate of the mutation, interpretation is upto concrete implementation of the mutator. Normally one would expect to keep it in (0; 1] interval. | |
check_range | if true, check is made that mutation rate is > 0 and < 1. |
Definition at line 20 of file GLBaseMutator.h.
GLBaseMutator::GLBaseMutator | ( | const GLBaseMutator & | mutator | ) |
Copying constructor.
mutator | source for copying. |
mutator | source to copy from. |
Definition at line 9 of file GLBaseMutator.cpp.
virtual GLBaseMutator::~GLBaseMutator | ( | ) | [inline, virtual] |
Destructor, destroys everything.
Definition at line 33 of file GLBaseMutator.h.
virtual GLBaseMutator* GLBaseMutator::copy | ( | ) | const [pure virtual] |
Creates copy of the current exemplar of the mutator. Should be overloaded in childrens.
Implemented in GLMutatorCombined, GLMutatorGeneMove, GLMutatorGenesSwapping, and GLMutatorShuffling.
double GLBaseMutator::getMutationRate | ( | ) | const [inline] |
Returns the mutation rate. Its interpretation depends on concrete implementation of the mutator.
Definition at line 47 of file GLBaseMutator.h.
virtual bool GLBaseMutator::mutateOrganism | ( | GLBaseOrganism * | organism | ) | [pure virtual] |
Performs the mutation on the organism. If passed organism was changed (mutated) returns true, otherwise returns false.
organism | organism to be mutated. |
Implemented in GLMutatorCombined, GLMutatorGeneMove, GLMutatorGenesSwapping, and GLMutatorShuffling.
void GLBaseMutator::reset | ( | ) | [virtual] |
Resets the mutator (e.g. sets counter, if any, to zero etc.).
Definition at line 18 of file GLBaseMutator.cpp.
void GLBaseMutator::setMutationRate | ( | double | mutation_rate, | |
bool | check_range = false | |||
) |
Sets the new mutation rate for the mutator.
mutation_rate | rate of the mutation, interpretation is upto concrete implementation of the mutator. Normally one would expect to keep it in (0; 1) interval. | |
checkRange | if true, check is made that mutation rate is > 0 and < 1. |
mutation_rate | rate of the mutation, interpretation is upto concrete implementation of the mutator. Normally one would expect to keep it in (0; 1] interval. | |
check_range | if true, check is made that mutation rate is > 0 and < 1. |
Definition at line 31 of file GLBaseMutator.cpp.