Public Member Functions | Public Attributes | Protected Attributes

Mutation Class Reference
[Evolutionary FrameworkEvolutionary Operators]

Mutation class - handles mutation of _individuals_ (as opposed to MutationOp class that mutates genotypes). More...

#include <Mutation.h>

List of all members.

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 > > 
 vectors of mutation operators for each genotype
std::vector< std::vector
< double > > 
 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

Detailed Description

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.

Member Function Documentation

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:

  • (not implemented!) if geneMutProb_ is defined in config, use that parameter with genotype's genome size
  • otherwise use indMutProb_

Called by: Algorithm::advanceGeneration

number of mutated individuals

Definition at line 133 of file Mutation.cpp.

The documentation for this class was generated from the following files: