1#include "../ECF_base.h" 
    2#include "Permutation.h" 
   10    myGenotype_->registerParameter(state, 
"mut.ins", (voidP) 
new double(0), ECF::DOUBLE);
 
   16    voidP sptr = 
myGenotype_->getParameterValue(state, 
"mut.ins");
 
   28    int ind1 = state_->getRandomizer()->getRandomInteger(perm->getSize() - 1);
 
   29    int ind2 = state_->getRandomizer()->getRandomInteger(ind1, (
int) perm->getSize() - 1);
 
   30    int temp = perm->variables[ind2];
 
   33    for(
int i = ind2; i > ind1; i--) {
 
   35        perm->variables[i] = perm->variables[i - 1];
 
   41        perm->variables[ind1 + 1] = 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)
 
bool mutate(GenotypeP gene)
Performs mutation of a genotype object. The genotype object must be initialized!
 
void registerParameters(StateP)
Register parameters with the system. Called before MutationOp::initialize.
 
bool initialize(StateP)
Initialize mutation operator. Called before first mutation operation.