#include <GLMutatorGeneMove.h>
Public Member Functions | |
GLMutatorGeneMove (double mutationRate=0.5) | |
GLMutatorGeneMove (const GLMutatorGeneMove &source) | |
virtual | ~GLMutatorGeneMove () |
virtual GLBaseMutator * | copy () const |
virtual bool | mutateOrganism (GLBaseOrganism *organism) |
Definition at line 10 of file GLMutatorGeneMove.h.
GLMutatorGeneMove::GLMutatorGeneMove | ( | double | mutationRate = 0.5 |
) | [inline] |
Simple constructor.
mutationRate | probability that gene will move. Should be in (0; 1) interval. |
Definition at line 18 of file GLMutatorGeneMove.h.
GLMutatorGeneMove::GLMutatorGeneMove | ( | const GLMutatorGeneMove & | source | ) | [inline] |
Copying constructor.
source | where the data should be copied from. |
Definition at line 25 of file GLMutatorGeneMove.h.
virtual GLMutatorGeneMove::~GLMutatorGeneMove | ( | ) | [inline, virtual] |
Destructor. Destroys everything.
Definition at line 31 of file GLMutatorGeneMove.h.
virtual GLBaseMutator* GLMutatorGeneMove::copy | ( | ) | const [inline, virtual] |
Creates copy of the current exemplar of the mutator. Should be overloaded in childrens.
Implements GLBaseMutator.
Definition at line 38 of file GLMutatorGeneMove.h.
bool GLMutatorGeneMove::mutateOrganism | ( | GLBaseOrganism * | organism | ) | [virtual] |
Mutator. Passed pointer should point to the class implementing GLMovableGeneInterface. Randomly chooses one gene and moves it to randomly chosen position (it is guaranteed, that new position is different from the current one unless the size of the organisms == 1).
organism | pointer to the organism to be mutated. |
Implements GLBaseMutator.
Definition at line 19 of file GLMutatorGeneMove.cpp.