1#include "CartesianMutOnePoint.h"
10 myGenotype_->registerParameter(state,
"mut.onepoint.prob", (voidP)
new double(0.001), ECF::DOUBLE);
20 voidP sptr =
myGenotype_->getParameterValue(state,
"mut.onepoint.prob");
21 mutProb_ = *((
double*)sptr.get());
24 if(
myGenotype_->isParameterDefined(state,
"mut.onepoint.prob"))
39 for (
int i = 0; i < mut->size(); i++)
41 if (state_->getRandomizer()->getRandomInteger(0, 1) < mutProb_)
50 uint mutPoint = (uint)(state_->getRandomizer()->getRandomInteger(0, mut->size() - 1));
52 mutOneValue(mut, mutPoint);
58void CartesianMutOnePoint::mutOneValue(
Cartesian *mut,
int mutPoint)
73 uint currCol = (uint)floor(num) + 1;
GenotypeP myGenotype_
pointer to the Genotype that defines this MutationOp
uint randInputConn(uint currCol)
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)