12int main(
int argc,
char **argv)
14 StateP state (
new State);
17 state->setEvalOp(evalOp);
21 uint primjer = atoi(argv[4]);
22 state->getContext()->environment =
new uint(primjer);
25 state->initialize(argc, argv);
28 ifstream inFile(argv[2]);
30 cout <<
"ne mogu otvoriti " << argv[1] << endl;
38 outFile.open(argv[3]);
44 while(getline(inFile, stablo)) {
47 stringstream ss(stablo);
54 string treeString =
"<Tree size=\"";
55 treeString += uint2str(size) +
"\">";
56 treeString += stablo +
"</Tree>";
57 XMLNode xTree = XMLNode::parseString(treeString.c_str(),
"Tree");
60 IndividualP ind = (IndividualP) state->getPopulation()->getLocalDeme()->at(0);
65 state->getAlgorithm()->evaluate(ind);
66 std::cout << ind->toString();
68 outFile << ind->getFitness()->getValue() << endl;
State class - backbone of the framework.
Tree class - implements genotype as a tree.
void read(XMLNode &)
Read genotype data from XMLNode.