ECF 1.5
|
Mutation class - handles mutation of individuals (as opposed to MutationOp class that mutates genotypes). More...
#include <Mutation.h>
Public Member Functions | |
bool | mutate (IndividualP ind) |
Mutate an individual. More... | |
uint | mutation (const std::vector< IndividualP > &) |
Perform mutation on a pool of individuals. More... | |
void | registerParameters (StateP) |
Register mutation related but Genotype unrelated parameters. More... | |
bool | initialize (StateP) |
Initialize all mutation operators of all active genotypes. More... | |
double | getIndMutProb () |
Return current individual mutation probability. More... | |
double | setIndMutProb (double) |
Set new individual mutation probability (ignored if not [0, 1]) More... | |
Public Attributes | |
std::vector< std::vector< MutationOpP > > | operators |
vectors of mutation operators for each genotype More... | |
std::vector< std::vector< double > > | opProb |
usage probabilities for each MutationOp operator More... | |
IndividualP | currentInd |
Protected Attributes | |
StateP | state_ |
double | indMutProb_ |
mutation probability of an individual More... | |
uint | mutateGenotypes_ |
what genotypes (if more than one) to mutate (random, all) More... | |
std::vector< bool > | protectedGenotypes_ |
protected (non-mutatable) genotypes flags More... | |
Mutation class - handles mutation of individuals (as opposed to MutationOp class that mutates genotypes).
Mutation class is in fact a repository of every mutation operator (MutationOp) for every active Genotype (the genotypes used in individuals). Determines which MutationOp will be used for each genotype. (every operator for every genotype has a usage probability)
Definition at line 54 of file Mutation.h.
double Mutation::getIndMutProb | ( | ) |
Return current individual mutation probability.
Definition at line 10 of file Mutation.cpp.
bool Mutation::initialize | ( | StateP | state | ) |
Initialize all mutation operators of all active genotypes.
Definition at line 45 of file Mutation.cpp.
bool Mutation::mutate | ( | IndividualP | ind | ) |
Mutate an individual.
May mutate one or more genotypes in given individual. Determines which MutationOp to use on each genotype.
Definition at line 153 of file Mutation.cpp.
uint Mutation::mutation | ( | const std::vector< IndividualP > & | pool | ) |
Perform mutation on a pool of individuals.
Mutation probability may be defined with 2 parameters:
Called by: Algorithm::advanceGeneration
Definition at line 133 of file Mutation.cpp.
void Mutation::registerParameters | ( | StateP | state | ) |
Register mutation related but Genotype unrelated parameters.
Definition at line 30 of file Mutation.cpp.
double Mutation::setIndMutProb | ( | double | newProb | ) |
Set new individual mutation probability (ignored if not [0, 1])
Definition at line 19 of file Mutation.cpp.
IndividualP Mutation::currentInd |
Definition at line 67 of file Mutation.h.
|
protected |
mutation probability of an individual
Definition at line 71 of file Mutation.h.
|
protected |
what genotypes (if more than one) to mutate (random, all)
Definition at line 72 of file Mutation.h.
std::vector< std::vector<MutationOpP> > Mutation::operators |
vectors of mutation operators for each genotype
Definition at line 64 of file Mutation.h.
std::vector< std::vector<double> > Mutation::opProb |
usage probabilities for each MutationOp operator
Definition at line 65 of file Mutation.h.
|
protected |
protected (non-mutatable) genotypes flags
Definition at line 73 of file Mutation.h.
|
protected |
Definition at line 70 of file Mutation.h.