MultiAgentDecisionProcess  Release 0.2.1
MultiAgentDecisionProcessDiscrete.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _MULTIAGENTDECISIONPROCESSDISCRETE_H_
30 #define _MULTIAGENTDECISIONPROCESSDISCRETE_H_ 1
31 
32 /* the include directives */
33 #include <vector>
34 #include <string>
35 
41 
42 class TGet;
43 
68 
69 {
70  private:
73 
77  bool _m_sparse;
78 
85  bool SanityCheck(void);
86 
89 
92 
93  protected:
94 
95  //data manipulation (set) functions:
101  bool SetInitialized(bool b);
102  public:
103  // Constructor, destructor and copy assignment.
106 
112  std::string name="received unspec. by MultiAgentDecisionProcessDiscrete",
113  std::string descr="received unspec.by MultiAgentDecisionProcessDiscrete",
114  std::string pf="received unspec. by MultiAgentDecisionProcessDiscrete");
122  int nrAgents, int nrS, std::string
123  name="received unspec. by MultiAgentDecisionProcessDiscrete",
124  std::string descr="received unspec.by MultiAgentDecisionProcessDiscrete",
125  std::string pf="received unspec. by MultiAgentDecisionProcessDiscrete");
126 
129 
133  bool Initialize()
134  {return SetInitialized(true);}
135 
140 
142  void SetTransitionProbability(Index sI, Index jaI, Index sucSI,
143  double p);
144 
146  void SetObservationProbability(Index jaI, Index sucSI, Index joI,
147  double p);
148 
149  // 'get' functions:
151  double GetTransitionProbability(Index sI, Index jaI, Index sucSI)
152  const;
153 
154  TGet* GetTGet() const;
155  OGet* GetOGet() const;
156 
158  double GetObservationProbability(Index jaI, Index sucSI, Index joI)
159  const;
160 
162  Index SampleSuccessorState(Index sI, Index jaI) const;
163 
165  Index SampleJointObservation(Index jaI, Index sucI) const;
166 
168  std::string SoftPrint() const;
170  void Print() const
171  { std::cout << SoftPrint();}
172 
178  void SetSparse(bool sparse);
179 
181  bool GetSparse() const { return(_m_sparse); }
182 
184  { return(_m_p_tModel); }
185 
187  { return(_m_p_oModel); }
188 
191  { _m_p_tModel=ptr; }
192 
195  { _m_p_oModel=ptr; }
196 
199  { return new MultiAgentDecisionProcessDiscrete(*this); }
200 
201 };
202 
203 #include "TransitionModelDiscrete.h"
205 
207  sI, Index jaI, Index sucSI, double p)
208 { _m_p_tModel->Set(sI, jaI, sucSI, p);}
210  jaI, Index sucSI, Index joI, double p)
211 { _m_p_oModel->Set(jaI, sucSI, joI,p);}
212 inline double
214  jaI, Index sucSI) const
215 { return(_m_p_tModel->Get(sI, jaI, sucSI));}
216 inline double
218  sucSI, Index joI) const
219 { return(_m_p_oModel->Get(jaI, sucSI, joI));}
221  sI, Index jaI) const
222 { return(_m_p_tModel->SampleSuccessorState(sI,jaI));}
224  jaI, Index sucI) const
225 { return(_m_p_oModel->SampleJointObservation(jaI,sucI)); }
226 
227 #endif /* !_MULTIAGENTDECISIONPROCESS_H_ */
228 
229 
230 // Local Variables: ***
231 // mode:c++ ***
232 // End: ***