MultiAgentDecisionProcess  Release 0.2.1
QAV.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _QAV_H_
30 #define _QAV_H_ 1
31 
32 /* the include directives */
33 #include <iostream>
34 #include "Globals.h"
35 
36 #include "QFunctionJointBelief.h"
37 #include "BeliefSet.h"
39 #include "AlphaVectorPlanning.h"
41 #include "QAVParameters.h"
42 
45 template<class P>
46 class QAV : public QFunctionJointBelief
47 {
48 private:
49 
50  P *_m_p;
51 
52  void Initialize(){};
53  void DeInitialize(){};
54 
55 protected:
56 
57 public:
58  // Constructor, destructor and copy assignment.
61  QFunctionForDecPOMDP(pu), //virtual base first
63  { _m_p=new P(pu); }
64 
66  const QAVParameters &params) :
67  QFunctionForDecPOMDP(pu), //virtual base first
69  { _m_p=new P(pu,params); }
70 
72  QFunctionForDecPOMDP(pu), //virtual base first
74  {
75  _m_p=new P(pu);
76  _m_p->SetBeliefSet(B);
77  }
78 
80  const QAVParameters &params) :
81  QFunctionForDecPOMDP(pu), //virtual base first
83  {
84  _m_p=new P(pu,params);
85  _m_p->SetBeliefSet(B);
86  }
87 
89  const std::string &ValueFunctionFile) :
90  QFunctionForDecPOMDP(pu), //virtual base first
92  {
93  _m_p=new P(pu);
94  _m_p->SetValueFunction(ValueFunctionFile);
95  }
96 
98  const std::string &ValueFunctionFile,
99  const QAVParameters &params) :
100  QFunctionForDecPOMDP(pu), //virtual base first
102  {
103  _m_p=new P(pu,params);
104  _m_p->SetValueFunction(ValueFunctionFile);
105  }
106 
109  {
110  delete _m_p;
111  }
112 
113 
114  void Compute()
115  {
116  _m_p->Plan();
117  }
118 
119  double GetQ(const JointBeliefInterface &b, Index jaI) const
120  {
121  return(_m_p->GetQ(b,jaI));
122  }
123 
124  double GetQ(const JointBeliefInterface &b, Index jaI, int &betaMaxI) const
125  {
126  return(_m_p->GetQ(b,jaI,betaMaxI));
127  }
128 
129  double GetQ(const JointBeliefInterface &b, Index t, Index jaI) const
130  {
131  return(_m_p->GetQ(b,t,jaI));
132  }
133 
134  double GetQ(const JointBeliefInterface &b, Index t, Index jaI,
135  int &betaMaxI) const
136  {
137  return(_m_p->GetQ(b,t,jaI,betaMaxI));
138  }
139 
141  { return(_m_p); }
142 };
143 
144 #endif /* !_QAV_H_ */
145 
146 // Local Variables: ***
147 // mode:c++ ***
148 // End: ***