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. | |
uint | mutation (const std::vector< IndividualP > &) |
Perform mutation on a pool of individuals. | |
void | registerParameters (StateP) |
Register mutation related but Genotype unrelated parameters. | |
bool | initialize (StateP) |
Initialize all mutation operators of all active genotypes. | |
double | getIndMutProb () |
Return current individual mutation probability. | |
double | setIndMutProb (double) |
Set new individual mutation probability (ignored if not [0, 1]). | |
Public Attributes | |
std::vector< std::vector < MutationOpP > > | operators |
vectors of mutation operators for each genotype | |
std::vector< std::vector < double > > | opProb |
usage probabilities for each MutationOp operator | |
IndividualP | currentInd |
Protected Attributes | |
StateP | state_ |
double | indMutProb_ |
mutation probability of an individual | |
uint | mutateGenotypes_ |
what genotypes (if more than one) to mutate (random, all) | |
std::vector< bool > | protectedGenotypes_ |
protected (non-mutatable) genotypes flags |
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.
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.