00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef CAGENTCONTROLLER_H
00033 #define CAGENTCONTROLLER_H
00034
00035 #include "cbaseobjects.h"
00036 #include "cagentlistener.h"
00037 #include "cparameters.h"
00038
00039
00040 #include <list>
00041
00042 class CStateCollection;
00043 class CActionStatistics;
00044
00046
00052 class CAgentController : public CActionObject, virtual public CParameterObject
00053 {
00054 public:
00056 CAgentController(CActionSet *actions);
00057 virtual ~CAgentController();
00058
00060 virtual CAction* getNextAction(CStateCollection *state, CActionDataSet *data = NULL) = 0;
00061
00062 };
00063
00065
00070 class CAgentStatisticController : public CAgentController
00071 {
00072 public:
00073 CAgentStatisticController(CActionSet *actions);
00074
00075 virtual CAction* getNextAction(CStateCollection *state, CActionDataSet *data = NULL);
00076 virtual CAction* getNextAction(CStateCollection *, CActionDataSet * = NULL, CActionStatistics * = NULL) {return NULL;};
00077 };
00078
00080
00094 class CDeterministicController : public CAgentController, public CSemiMDPListener
00095 {
00096 protected:
00098 CAction *nextAction;
00100
00103 CAgentController *controller;
00105
00108 CAgentStatisticController *statisticController;
00110 CActionStatistics *statistics;
00111 bool useStatisticController;
00112
00114 CActionDataSet *actionDataSet;
00115
00116 void initStatistics();
00117
00118 public:
00120 CDeterministicController(CActionSet *actions);
00122 CDeterministicController(CAgentController *controller);
00124 CDeterministicController(CAgentStatisticController *controller);
00125 virtual ~CDeterministicController();
00126
00128
00130 virtual CAction* getNextAction(CStateCollection *state, CActionDataSet *data = NULL);
00131
00133 virtual void nextStep(CStateCollection *state1, CAction *action, CStateCollection *state2);
00135 virtual void newEpisode();
00136
00138
00139 CActionStatistics *getLastActionStatistics();
00140 bool isUsingStatisticController();
00141
00143 void setController(CAgentController *controller);
00145
00146 void setController(CAgentStatisticController *controller);
00147
00148 CAgentController *getController() {return controller;};
00149
00150 void setNextAction(CAction *action, CActionData *data = NULL);
00151 };
00152
00153
00154 #endif