2#include <ecf/ECF_base.h>
5#include "IntGenotype.h"
12 IntGenotype* p1 = (IntGenotype*)(gen1.get());
13 IntGenotype* p2 = (IntGenotype*)(gen2.get());
14 IntGenotype* ch = (IntGenotype*)(child.get());
31 uint dimensionCrs = state_->getRandomizer()->getRandomInteger((
int)p1->intValues.size());
32 switch (state_->getRandomizer()->getRandomInteger(0, 1)) {
33 case 0:
for (uint i = 0; i < dimensionCrs; i++) {
34 ch->intValues[i] = p1->intValues[i];
36 for (uint i = dimensionCrs; i < p2->intValues.size(); i++) {
37 ch->intValues[i] = p2->intValues[i];
40 case 1:
for (uint i = 0; i < dimensionCrs; i++) {
41 ch->intValues[i] = p2->intValues[i];
43 for (uint i = dimensionCrs; i < p1->intValues.size(); i++) {
44 ch->intValues[i] = p1->intValues[i];
bool mate(GenotypeP gen1, GenotypeP gen2, GenotypeP child)