ECF 1.7
IntGenotypeMutOp.cpp
1#include "../ECF_base.h"
2#include <cmath>
3#include "IntGenotype.h"
4
5namespace IntGenotype
6{
7
8 bool IntGenotypeMutOp::mutate(GenotypeP gene)
9 {
10 IntGenotype* gen = (IntGenotype*) (gene.get());
11
12 int a = state_->getRandomizer()->getRandomInteger(gen->intValues.size());
13 gen->intValues[a] = state_->getRandomizer()->getRandomInteger(gen->getLBound(), gen->getUBound());
14
15 return true;
16 }
17
18}
IntGenotype class - implements genotype as a vector of int values.
Definition IntGenotype.h:28
bool mutate(GenotypeP gene)
Performs mutation of a genotype object. The genotype object must be initialized!