ECF 1.5
main.cpp
1#include <ECF/ECF.h>
2#include "SymbRegEvalOp.h"
3
4
5int main(int argc, char **argv)
6{
7 StateP state (new State);
8
9 // set the evaluation operator
10 state->setEvalOp(new SymbRegEvalOp);
11
12 state->initialize(argc, argv);
13 state->run();
14
15 // after the evolution: show best solution in Tree form
16 std::vector<IndividualP> hof = state->getHoF()->getBest();
17 IndividualP ind = hof[0];
18 Tree::Tree* tree = (Tree::Tree*) ((Tree::APGenotype*) ind->getGenotype().get())->convertToPhenotype();
19 std::cout << tree->toString();
20
21 return 0;
22}
std::string toString()
Output genotype to string.
Definition: Genotype.h:98
State class - backbone of the framework.
Definition: State.h:39
Symbolic regression evaluation operator (using AP genotype).
Definition: SymbRegEvalOp.h:29
Analytical Programing genotype class - implements genotype as a vector of floating point values that ...
Definition: APGenotype.h:50
Tree class - implements genotype as a tree.
Definition: Tree_c.h:29