3#include "SymbRegEvalOp.h"
11 for(uint i = 0; i < nSamples; i++) {
13 codomain.push_back(x + sin(x));
17 useAPGenotype =
false;
18 GenotypeP activeGenotype = state->getGenotypes()[0];
19 if(activeGenotype->getName() ==
"APGenotype")
35 if (useAPGenotype ==
true)
38 tree = (
Tree::Tree*) individual->getGenotype().get();
41 for(uint i = 0; i < nSamples; i++) {
43 if(useAPGenotype ==
true)
44 apg->setTerminalValue(tree,
"X", &domain[i]);
51 value += fabs(codomain[i] - result);
53 fitness->setValue(value);
FitnessP evaluate(IndividualP individual)
Evaluate a single individual. Method must create and return a Fitness object.
bool initialize(StateP)
Initialize the evaluator. Called before first evaluation occurs.
Fitness for minimization problems.
Analytical Programing genotype class - implements genotype as a vector of floating point values that ...
Tree class - implements genotype as a tree.
void setTerminalValue(std::string, void *)
Set a terminal's value.
void execute(void *)
Execute current tree.