ECF 1.5
TurnLeft.h
1#include "AntEvalOp.h"
2
3
9{
10public:
11 TurnLeft()
12 {
13 nArguments_ = 0;
14 name_ = "left";
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 left
22 ant->turnLeft();
23 }
24
25 ~TurnLeft()
26 { }
27};
Artificial ant evaluation class (and environment simulator)
Definition: AntEvalOp.h:51
void turnLeft()
Turn ant on the left.
Definition: AntEvalOp.cpp:183
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 left.
Definition: TurnLeft.h:9
void execute(void *evalOp, Tree::Tree &tree)
Execute the primitive.
Definition: TurnLeft.h:17