00001 #ifndef AgentEvalOp_h
00002 #define AgentEvalOp_h
00003
00004 #include "Maze.h"
00005
00006 using namespace std;
00007
00008 class AgentEvalOp : public EvaluateOp
00009 {
00010
00011 protected:
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 pair<int,int> currentPosition;
00023 pair<int,int> posOffset;
00024
00025 set< pair<int,int> > memory;
00026
00027 int direction;
00028 int startingDirection;
00029 int moves;
00030 int steps;
00031
00032 bool isOut;
00033
00034 StateP state_;
00035
00036 public:
00037 FitnessP evaluate(IndividualP individual);
00038 bool initialize(StateP);
00039
00040 void turnLeft(void);
00041 void turnRight(void);
00042 void stepFoward(void);
00043 bool checkLeftWall(void);
00044 bool checkRightWall(void);
00045 bool checkFrontWall(void);
00046 int checkIfVisited(void);
00047
00048 };
00049 typedef boost::shared_ptr<AgentEvalOp> AgentEvalOpP;
00050
00051 #endif