ECF
1.7
D:
Projekt
ECF
ECF_master
ECF
intgenotype
IntGenotypeMutOp.cpp
1
#include "../ECF_base.h"
2
#include <cmath>
3
#include "IntGenotype.h"
4
5
namespace
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::IntGenotype
IntGenotype class - implements genotype as a vector of int values.
Definition
IntGenotype.h:28
IntGenotype::IntGenotypeMutOp::mutate
bool mutate(GenotypeP gene)
Performs mutation of a genotype object. The genotype object must be initialized!
Definition
IntGenotypeMutOp.cpp:8
Generated on
for ECF by
1.18.0