1#include "../ECF_base.h"
2#include "FloatingPoint.h"
10 myGenotype_->registerParameter(state,
"crx.heuristic", (voidP)
new double(0), ECF::DOUBLE);
16 voidP sptr =
myGenotype_->getParameterValue(state,
"crx.heuristic");
30 for (uint i = 1; i < p1->realValue.size(); i++) {
31 a = state_->getRandomizer()->getRandomDouble();
32 if (p1->realValue[i] <= p2->realValue[i])
33 ch->realValue[i] = p1->realValue[i] + a*(p2->realValue[i] - p1->realValue[i]);
35 ch->realValue[i] = p2->realValue[i] + a*(p1->realValue[i] - p2->realValue[i]);
double probability_
probability of usage of this crossover operator
GenotypeP myGenotype_
pointer to the Genotype that defines this CrossoverOp
bool initialize(StateP)
Initialize crossover operator. Called before first crossover operation.
bool mate(GenotypeP gen1, GenotypeP gen2, GenotypeP child)
void registerParameters(StateP)
Register parameters with the system. Called before CrossoverOp::initialize.
FloatingPoint class - implements genotype as a vector of floating point values.