MultiAgentDecisionProcess  Release 0.2.1
QMDP.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _QMDP_H_
30 #define _QMDP_H_ 1
31 
32 /* the include directives */
33 #include <iostream>
34 #include "Globals.h"
35 
36 #include "MDPValueIteration.h"
37 #include "QFunctionJAOH.h"
39 
45 class QMDP : virtual public QFunctionJAOH,
46  virtual public QFunctionJointBeliefInterface
47 {
48 private:
49 
51 
53 
54  void Initialize();
55  void DeInitialize();
56 
57  void CacheJaohQValues();
58 
59 protected:
60 
61 public:
62  // Constructor, destructor and copy assignment.
65  bool useJaohQValuesCache=false);
67  ~QMDP();
68 
69  //operators:
70 
71  //data manipulation (set) functions:
72 
82  void Compute();
83 
84  //get (data) funct
88  double GetQNoCache(Index jaohI, Index jaI) const;
89 
90  double GetQ(Index jaohI, Index jaI) const
91  { if(_m_useJaohQValuesCache) return (_m_QValues(jaohI,jaI));
92  else return(GetQNoCache(jaohI,jaI)); }
93 
94  void SetPU(const PlanningUnitDecPOMDPDiscrete& pu);
95 
96  double GetQ(const JointBeliefInterface &b, Index jaI) const;
97  double GetQ(const JointBeliefInterface &b, Index time_step,
98  Index jaI) const;
99 
100  double GetQSA(Index t, Index sI, Index jaI) const;
101 
102  void Save(std::string filename) const;
103 
104  void Load(std::string filename);
105 
106 };
107 
108 
109 #endif /* !_QMDP_H_ */
110 
111 // Local Variables: ***
112 // mode:c++ ***
113 // End: ***