#ifndef Tree_c_h #define Tree_c_h #include "Node.h" #include "../Genotype.h" #include #define MAX_ARGS 10 enum terminal_type { Double, Int, Bool, Char, String, }; class PrimitiveSet; typedef boost::shared_ptr PrimitiveSetP; class Tree : public std::vector, public Genotype { public: Tree(); Tree(int min, int max); void growBuild(PrimitiveSetP primitiveSet); void fullBuild(PrimitiveSetP primitiveSet); void update(); void calculate(void*); void addNode(Node* node); void addNode(NodeP node); void setTerminalValue(std::string, void*); void printTreeFunction(); ~Tree(); Tree* copy() { Tree *newObject = new Tree(*this); return newObject; } void write(XMLNode&); void read(XMLNode&); void registerParameters(StateP); bool initialize (StateP state); std::vector getMutationOp(); std::vector getCrossoverOp(); //&&&&&&&&&&&&&&&&&&&&&&&&&|>new - AA<|&&&&&&&&&&&&&&&&&&&&&&&&&& char AAgetCurDirection(); void AAsetDirection(char dir); uint AAgetCurPosI(); uint AAgetCurPosJ(); void AAsetPosI(uint posI); void AAsetPosJ(uint posJ); uint AAgetArrSizeI(); uint AAgetArrSizeJ(); void AAsetArrSizeI(uint sizeI); void AAsetArrSizeJ(uint sizeJ); uint AAgetCollected(); void AAincCollected(); void AAsetCollected(uint collected); std::vector AAarray2D; //&&&&&&&&&&&&&&&&&&&&&&&&|>end new - AA<|&&&&&&&&&&&&&&&&&&&&&&&& // pridruzeni primitiveSet treba biti dostupan stablu! PrimitiveSetP primitiveSet_; uint startDepth; uint maxDepth; uint minDepth; uint iNode; private: uint growBuild_(PrimitiveSetP primitiveSet, int myDepth); uint fullBuild_(PrimitiveSetP primitiveSet, int myDepth); uint getSize_(); void setDepth_(int myDepth); //&&&&&&&&&&&&&&&&&&&&&&&|>new - AA<|&&&&&&&&&&&&&&&&&&&&&&&&&& char AAdirection_; uint AAposI_, AAposJ_, AAsizeI_, AAsizeJ_, AAcollected_; //&&&&&&&&&&&&&&&&&&&&&|>end new - AA<|&&&&&&&&&&&&&&&&&&&&&&&& }; typedef boost::shared_ptr TreeP; /*! Klasa Tree predstavlja implementaciju strukture stabla za ostvarenje genetskog vorova (klasa Node). asa se sastoji od */ #endif