Public Member Functions | Public Attributes | Protected Attributes

Mutation Class Reference

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)
bool initialize (StateP)

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
double geneMutProb_
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).

Contains pointers to every MutationOp for every genotype used in individuals. Determines which MutationOp will be used for each genotype.

Definition at line 55 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 124 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:

  • if geneMutProb_ is defined in config, use that parameter with genotype's genome size
  • otherwise use indMutProb_

Called by: Algorithm::advanceGeneration

Returns:
number of mutated individuals

Definition at line 104 of file Mutation.cpp.


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