MultiAgentDecisionProcess  Release 0.2.1
MDPSolver.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _MDPSOLVER_H_
30 #define _MDPSOLVER_H_ 1
31 
32 /* the include directives */
33 #include <iostream>
34 #include "Globals.h"
35 
36 #include "QTable.h"
37 
40 
43 class MDPSolver
44 {
45 private:
46 
50 
51 protected:
52 
53 public:
54  // Constructor, destructor and copy assignment.
56  MDPSolver(){};
57 
59 
62  { return(_m_pu); }
63 
64  void SetPU(const PlanningUnitDecPOMDPDiscrete& pu){ _m_pu=&pu; }
65 
67  virtual ~MDPSolver();
68 
69  virtual void Plan() = 0;
70 
72  virtual double GetQ(Index time_step, Index sI,
73  Index jaI) const = 0;
74 
76  virtual double GetQ(Index sI, Index jaI) const = 0;
77 
78  virtual double GetQ(Index time_step, const JointBeliefInterface& jb,
79  Index jaI) const;
80 
81  virtual double GetQ(const JointBeliefInterface& jb,
82  Index jaI) const;
83 
84  virtual QTables GetQTables() const = 0;
85 
86  virtual QTable GetQTable(Index time_step) const = 0;
87 
88  virtual void SetQTables(const QTables &Qs) = 0;
89 
90  virtual void SetQTable(const QTable &Q, Index time_step) = 0;
91 
92  void Print() const;
93 
94  Index GetMaximizingAction(Index time_step, Index sI);
95 
96  QTable LoadQTable(std::string filename);
97 
98  static QTable LoadQTable(std::string filename,
99  unsigned int nrS,
100  unsigned int nrA);
101 
102  QTables LoadQTables(std::string filename, int nrTables);
103 
104  static QTables LoadQTables(std::string filename,
105  unsigned int nrS,
106  unsigned int nrA,
107  unsigned int nrTables);
108 
109  static void SaveQTable(const QTable &Q, std::string filename);
110 
111  static void SaveQTables(const QTables &Q, std::string filename);
112 };
113 
114 
115 #endif /* !_MDPSOLVER_H_ */
116 
117 // Local Variables: ***
118 // mode:c++ ***
119 // End: ***