1#include "MutConnection.h"
2#include "Cartesian_genotype.h"
3#include "FunctionSet.h"
7 myGenotype_->registerParameter(state,
"mut.connection", (voidP)
new double(0), ECF::DOUBLE);
12 voidP sptr =
myGenotype_->getParameterValue(state,
"mut.connection");
20 const std::vector<FunctionP_basic>& vRef = cartesian->functionSet_->vActiveFunctions_;
22 uint whichOutput = cartesian->get_random_int(0, cartesian->
nOutputs - 1);
24 uint whoIsMutated = trail[cartesian->get_random_int(0, trail.size() - 1)];
25 uint rowNumber = cartesian->getRowNumber(whoIsMutated);
26 uint whichConnection = cartesian->get_random_int(0, vRef[cartesian->operator[](whoIsMutated).value]->getNumOfArgs() - 1);
28 cartesian->operator[](whoIsMutated).inputConnections[whichConnection] = newConnection;
double probability_
probability of usage of this mutation operator
GenotypeP myGenotype_
pointer to the Genotype that defines this MutationOp
uint randomConnectionGenerator(uint rowNumber)
std::vector< uint > getActiveTrail(uint output_number)
uint nOutputs
number of final outputs
bool initialize(StateP state)
Initialize mutation operator. Called before first mutation operation.
bool mutate(GenotypeP gene)
Performs mutation of a genotype object. The genotype object must be initialized!
void registerParameters(StateP state)
Register parameters with the system. Called before MutationOp::initialize.