ECF
1.7
D:
Projekt
ECF
ECF_master
ECF
intgenotype
IntGenotypeCrxAverage.cpp
1
#include "../ECF_base.h"
2
#include <cmath>
3
#include "IntGenotype.h"
4
5
namespace
IntGenotype
6
{
7
8
bool
IntGenotypeCrxAverage::mate
(GenotypeP gen1, GenotypeP gen2, GenotypeP child) {
9
10
IntGenotype
* p1 = (
IntGenotype
*)(gen1.get());
11
IntGenotype
* p2 = (
IntGenotype
*)(gen2.get());
12
IntGenotype
* ch = (
IntGenotype
*)(child.get());
13
14
for
(uint i = 0; i < p1->intValues.size(); i++) {
15
ch->intValues[i] = (int) (0.5 * (p1->intValues[i]) + 0.5 * (p2->intValues[i]));
16
}
17
18
19
return
true
;
20
}
21
22
}
IntGenotype::IntGenotypeCrxAverage::mate
bool mate(GenotypeP gen1, GenotypeP gen2, GenotypeP child)
Definition
IntGenotypeCrxAverage.cpp:8
IntGenotype::IntGenotype
IntGenotype class - implements genotype as a vector of int values.
Definition
IntGenotype.h:28
Generated on
for ECF by
1.18.0