#include <GLMutatorShuffling.h>
Classes | |
struct | TParameters |
Public Member Functions | |
GLMutatorShuffling (double mutation_rate, const GLMutatorShuffling::TParameters *const parameters) | |
GLMutatorShuffling (const GLMutatorShuffling &source) | |
virtual | ~GLMutatorShuffling () |
virtual GLBaseMutator * | copy () const |
virtual bool | mutateOrganism (GLBaseOrganism *organism) |
Definition at line 11 of file GLMutatorShuffling.h.
GLMutatorShuffling::GLMutatorShuffling | ( | double | mutation_rate, | |
const GLMutatorShuffling::TParameters *const | parameters | |||
) |
Constructor. Sets parameters.
mutation_rate | probability that organism will be mutated. | |
parameters | structure which contains maximum number of genes to shuffle and flag which determines how this number is chosen. |
Definition at line 18 of file GLMutatorShuffling.cpp.
GLMutatorShuffling::GLMutatorShuffling | ( | const GLMutatorShuffling & | source | ) | [inline] |
Copying constructor.
source | where the data are copied from. |
Definition at line 28 of file GLMutatorShuffling.h.
virtual GLMutatorShuffling::~GLMutatorShuffling | ( | ) | [inline, virtual] |
Destructor -- destroys everything.
Definition at line 35 of file GLMutatorShuffling.h.
virtual GLBaseMutator* GLMutatorShuffling::copy | ( | ) | const [inline, virtual] |
Creates copy of the current exemplar of the mutator. Should be overloaded in childrens.
Implements GLBaseMutator.
Definition at line 42 of file GLMutatorShuffling.h.
bool GLMutatorShuffling::mutateOrganism | ( | GLBaseOrganism * | organism | ) | [virtual] |
Performs the mutation on the organism. Chooses the number of genes to shuffle, which genes to shuffle and then shuffles them. If passed organism was changed (mutated) returns true, otherwise returns false.
organism | organism to be mutated. |
organism did not mutated.
Implements GLBaseMutator.
Definition at line 34 of file GLMutatorShuffling.cpp.