1#include "../ECF_base.h"
9 myGenotype_->registerParameter(state,
"crx.halfuniform", (voidP)
new double(0), ECF::DOUBLE);
15 voidP sptr =
myGenotype_->getParameterValue(state,
"crx.halfuniform");
28 for (uint dimension = 0; dimension < p1->variables.size(); dimension++) {
29 for(uint i = 0; i < p1->getNumBits(); i++) {
30 if (p1->variables[dimension][i] != p2->variables[dimension][i])
34 counter = (uint) counter/2;
35 uint parent = state_->getRandomizer()->getRandomInteger(0, 1);
37 for(uint i = 0; i < p1->getNumBits(); i++) {
38 if (p1->variables[dimension][i] == p2->variables[dimension][i])
39 ch->variables[dimension][i] = p1->variables[dimension][i];
42 ch->variables[dimension][i] = state_->getRandomizer()->getRandomInteger(2) ?
true:
false;
47 ch->variables[dimension][i] = p1->variables[dimension][i];
49 ch->variables[dimension][i] = p2->variables[dimension][i];
Binary class - implements genotype as a vector of binary coded real values with variable interval and...
double probability_
probability of usage of this crossover operator
GenotypeP myGenotype_
pointer to the Genotype that defines this CrossoverOp