1#include "../ECF_base.h" 
    2#include "Permutation.h" 
   10    myGenotype_->registerParameter(state, 
"mut.toggle", (voidP) 
new double(0), ECF::DOUBLE);
 
   16    voidP sptr = 
myGenotype_->getParameterValue(state, 
"mut.toggle");
 
   26    int ind1 = state_->getRandomizer()->getRandomInteger(perm->getSize());
 
   27    int ind2 = state_->getRandomizer()->getRandomInteger(perm->getSize());
 
   28    int temp = perm->variables[ind1];
 
   29    perm->variables[ind1] = perm->variables[ind2];
 
   30    perm->variables[ind2] = temp;
 
double probability_
probability of usage of this mutation operator
 
GenotypeP myGenotype_
pointer to the Genotype that defines this MutationOp
 
Permutation class - implements genotype as a vector of indices 0..(n-1) (permutation of indices)
 
void registerParameters(StateP)
Register parameters with the system. Called before MutationOp::initialize.
 
bool initialize(StateP)
Initialize mutation operator. Called before first mutation operation.
 
bool mutate(GenotypeP gene)
Performs mutation of a genotype object. The genotype object must be initialized!