9#define BOOL_PREFIX "B_"
10#define CHR_PREFIX "C_"
11#define STR_PREFIX "S_"
24{ Double, Int, Bool, Char, String };
27typedef boost::shared_ptr<Primitive> PrimitiveP;
49 virtual void setValue(
void* value);
50 virtual void getValue(
void* value);
65 std::string complementName_;
69typedef boost::shared_ptr<Primitives::Primitive> PrimitiveP;
Base primitive class (Tree genotype).
virtual PrimitiveP copyWithNode(PrimitiveP)
Copy primitive (when copying a node, e.g. in crossover). The default behaviour just returns the same ...
virtual void execute(void *result, Tree &tree)=0
Execute the primitive.
std::string getName()
Get primitive's name.
int getNumberOfArguments()
Return primitive's number of arguments.
void skipNextArgument(Tree &tree)
Skip next child subtree (doesn't execute the subtree).
std::string getComplementName()
Get complement's name.
void getNextArgument(void *result, Tree &tree)
Execute next child node's primitive (execute next subtree).
virtual bool initialize(StateP state)
Initialize the primitive (default just sets the StateP pointer).
void setName(std::string name)
Set primitive's name.
virtual PrimitiveP assignToNode(PrimitiveP)
Assign primitive to node (when building a tree). The default behaviour just returns the same pointer ...
Tree class - implements genotype as a tree.