00001 // 00002 // C++ Interface: Environment 00003 // 00004 // Description: Environment description 00005 // 00006 // 00007 // Author: Michel Tokic <michel@tokic.com>, (C) 2009 00008 // 00009 // Copyright: See COPYING file that comes with this distribution 00010 // 00011 // 00012 #ifndef _ENVIRONMENT_H_ 00013 #define _ENVIRONMENT_H_ 00014 00015 #include "FeedbackSensor.h" 00016 #include "BioloidServo.h" 00017 00021 typedef struct actionReturn { 00022 ENV_POS state; 00023 int reward; 00024 } ACTION_RETURN; 00025 00026 00030 class Environment { 00031 00032 private: 00033 00034 FeedbackSensor* r; 00035 00036 BioloidServo* servo_x; 00037 BioloidServo* servo_y; 00038 00039 ENV_POS currentPos; 00040 ENV_POS discretization; 00041 00042 public: 00043 Environment(ENV_POS* discretization); 00044 ~Environment(); 00045 void doAction(unsigned int action, unsigned int delayTime, ACTION_RETURN* actionReturn); 00046 void beamRobotToState(ENV_POS* pos); 00047 void setDiscretization(ENV_POS* discretization); 00048 void getDiscretization(ENV_POS* discretization); 00049 void getCurrentState(ENV_POS* pos); 00050 bool isValidAction(ENV_POS* pos, unsigned char action); 00051 }; 00052 00053 00054 #endif