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