ECF 1.5
main.cpp
1#include <ecf/ECF.h>
2#include "SymbRegEvalOp.h"
3#include "WriteBest.h"
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->addOperator((OperatorP) new WriteBest);
13
14 state->initialize(argc, argv);
15
16 if(argc == 3) {
17 XMLNode xInd = XMLNode::parseFile(argv[2], "Individual");
18 IndividualP ind = (IndividualP) new Individual(state);
19 ind->read(xInd);
20 evaluateVerbose = true;
21 ind->fitness = state->getEvalOp()->evaluate(ind);
22 std::cout << ind->toString();
23 return 0;
24 }
25
26 state->run();
27
28 return 0;
29}
Individual class - inherits a vector of Genotype objects.
Definition: Individual.h:12
void read(XMLNode &)
read individual from XML node
Definition: Individual.cpp:103
State class - backbone of the framework.
Definition: State.h:39
Symbolic regression evaluation operator (using AP genotype).
Definition: SymbRegEvalOp.h:29