2#include <ecf/ECF_base.h>
5#include "IntGenotype.h"
31 uint dimensionCrs1 = state_->getRandomizer()->getRandomInteger((
int)p1->intValues.size());
32 uint dimensionCrs2, tmp;
36 dimensionCrs2 = state_->getRandomizer()->getRandomInteger(p1->intValues.size());
37 }
while (dimensionCrs1 == dimensionCrs2);
39 if (dimensionCrs1 > dimensionCrs2)
42 dimensionCrs1 = dimensionCrs2;
46 switch (state_->getRandomizer()->getRandomInteger(0, 1)) {
47 case 0:
for (uint i = 0; i < dimensionCrs1; i++) {
48 ch->intValues[i] = p1->intValues[i];
50 for (uint i = dimensionCrs1; i < dimensionCrs2; i++) {
51 ch->intValues[i] = p2->intValues[i];
53 for (uint i = dimensionCrs2; i < p1->intValues.size(); i++) {
54 ch->intValues[i] = p1->intValues[i];
57 case 1:
for (uint i = 0; i < dimensionCrs1; i++) {
58 ch->intValues[i] = p2->intValues[i];
60 for (uint i = dimensionCrs1; i < dimensionCrs2; i++) {
61 ch->intValues[i] = p1->intValues[i];
63 for (uint i = dimensionCrs2; i < p2->intValues.size(); i++) {
64 ch->intValues[i] = p2->intValues[i];
bool mate(GenotypeP gen1, GenotypeP gen2, GenotypeP child)