5typedef boost::shared_ptr<Individual> IndividualP;
7typedef boost::shared_ptr<Genotype> GenotypeP;
43typedef boost::shared_ptr<MutationOp> MutationOpP;
57 bool mutate(IndividualP ind);
58 uint
mutation(
const std::vector<IndividualP>&);
65 std::vector< std::vector<double> >
opProb;
67 IndividualP currentInd;
76typedef boost::shared_ptr<Mutation> MutationP;
Individual class - inherits a vector of Genotype objects.
Mutation class - handles mutation of individuals (as opposed to MutationOp class that mutates genotyp...
double getIndMutProb()
Return current individual mutation probability.
double setIndMutProb(double)
Set new individual mutation probability (ignored if not [0, 1])
uint mutateGenotypes_
what genotypes (if more than one) to mutate (random, all)
std::vector< bool > protectedGenotypes_
protected (non-mutatable) genotypes flags
bool initialize(StateP)
Initialize all mutation operators of all active genotypes.
uint mutation(const std::vector< IndividualP > &)
Perform mutation on a pool of individuals.
bool mutate(IndividualP ind)
Mutate an individual.
double indMutProb_
mutation probability of an individual
void registerParameters(StateP)
Register mutation related but Genotype unrelated parameters.
std::vector< std::vector< double > > opProb
usage probabilities for each MutationOp operator
std::vector< std::vector< MutationOpP > > operators
vectors of mutation operators for each genotype
virtual bool initialize(StateP)
Initialize mutation operator. Called before first mutation operation.
virtual bool mutate(GenotypeP)=0
Performs mutation of a genotype object. The genotype object must be initialized!
virtual void registerParameters(StateP)
Register parameters with the system. Called before MutationOp::initialize.
double probability_
probability of usage of this mutation operator
GenotypeP myGenotype_
pointer to the Genotype that defines this MutationOp