ECF 1.5
TurnRight.h
1#include "AntEvalOp.h"
2
3
9{
10public:
11 TurnRight()
12 {
13 nArguments_ = 0;
14 name_ = "right";
15 }
16
17 void execute(void* evalOp, Tree::Tree& tree)
18 {
19 // get pointer to simulator from the context
20 AntEvalOp* ant = (AntEvalOp*) state_->getContext()->environment;
21 // turn us right
22 ant->turnRight();
23 }
24
26 { }
27};
Artificial ant evaluation class (and environment simulator)
Definition: AntEvalOp.h:51
void turnRight()
Turn ant on the right.
Definition: AntEvalOp.cpp:197
Base primitive class (Tree genotype).
Definition: Primitive.h:37
Tree class - implements genotype as a tree.
Definition: Tree_c.h:29
GP terminal, turns the ant right.
Definition: TurnRight.h:9
void execute(void *evalOp, Tree::Tree &tree)
Execute the primitive.
Definition: TurnRight.h:17