#include <GLMutatorGenesSwapping.h>
Public Member Functions | |
GLMutatorGenesSwapping (double mutationRate=0.5) | |
GLMutatorGenesSwapping (const GLMutatorGenesSwapping &source) | |
virtual | ~GLMutatorGenesSwapping () |
virtual GLBaseMutator * | copy () const |
virtual bool | mutateOrganism (GLBaseOrganism *organism) |
Definition at line 11 of file GLMutatorGenesSwapping.h.
GLMutatorGenesSwapping::GLMutatorGenesSwapping | ( | double | mutationRate = 0.5 |
) | [inline] |
Simple constructor.
mutationRate | probability that 2 gene will be swapped. Should be in (0; 1) interval. |
Definition at line 19 of file GLMutatorGenesSwapping.h.
GLMutatorGenesSwapping::GLMutatorGenesSwapping | ( | const GLMutatorGenesSwapping & | source | ) | [inline] |
Copying constructor.
source | where the data should be copied from. |
Definition at line 26 of file GLMutatorGenesSwapping.h.
virtual GLMutatorGenesSwapping::~GLMutatorGenesSwapping | ( | ) | [inline, virtual] |
Destructor, destroys everything.
Definition at line 32 of file GLMutatorGenesSwapping.h.
virtual GLBaseMutator* GLMutatorGenesSwapping::copy | ( | ) | const [inline, virtual] |
Creates copy of the current exemplar of the mutator. Should be overloaded in childrens.
Implements GLBaseMutator.
Definition at line 39 of file GLMutatorGenesSwapping.h.
bool GLMutatorGenesSwapping::mutateOrganism | ( | GLBaseOrganism * | organism | ) | [virtual] |
Mutator. Passed pointer should point to the class implementing GLExchengableGenesInterface. Randomly chooses 2 genes and swap them.
organism | pointer to the organism to be mutated. |
organism | pointer to the organism to be mutated. | |
mutation_probability | probability of the organism to be mutated. |
Implements GLBaseMutator.
Definition at line 19 of file GLMutatorGenesSwapping.cpp.