• Main Page
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List

D:/Projekt/ECF_trunk/examples/GPMaze/AgentEvalOp.h

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             currentPosition     - current agent position (position from starting point of agent)
00014             posOffset           - starting point of agent
00015             direction           - direction determined by starting direction
00016             dirOffset           - real direction the agent faces
00017             moves               - number of moves that agent did (turns, steps/failed steps)
00018             steps               - only steps that agent was able to carry through (turns doesnt count)
00019             isOut               - represent if agent moved to location that is in fact an exit
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

Generated on Fri Jul 13 2012 10:53:29 for ECF by  doxygen 1.7.1