3#include "SymbRegEvalOp.h"
11 for(uint i = 0; i < nSamples; i++) {
13 codomain.push_back(x + sin(x));
21 std::map<std::string, Tree::PrimitiveP>::iterator it = tree->primitiveSet_->mAllPrimitives_.begin();
22 while(it != tree->primitiveSet_->mAllPrimitives_.end()) {
23 Tree::PrimitiveP func;
24 if(func = tree->primitiveSet_->getFunctionByName(it->first)) {
25 cout << func->getName();
26 cout <<
"\t" << func->getNumberOfArguments() << endl;
34 std::string izraz =
"<Tree size=\"3\">+ D_1 D_2</Tree>";
35 XMLNode xTree = XMLNode::parseString(izraz.c_str());
39 cout << result << endl;
56 for(uint i = 0; i < nSamples; i++) {
63 value += fabs(codomain[i] - result);
65 fitness->setValue(value);
Fitness for minimization problems.
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.
Tree class - implements genotype as a tree.
void setTerminalValue(std::string, void *)
Set a terminal's value.
Tree * copy()
Create an identical copy of the genotype object.
void execute(void *)
Execute current tree.
void read(XMLNode &)
Read genotype data from XMLNode.