MultiAgentDecisionProcess  Release 0.2.1
PolicyPureVector.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _POLICYPUREVECTOR_H_
30 #define _POLICYPUREVECTOR_H_ 1
31 
32 /* the include directives */
33 #include <iostream>
34 #include <cmath>
35 #include "PolicyDiscretePure.h"
36 #include "ObservationHistoryTree.h"
37 #include "E.h"
38 
39 
53 {
54  private:
55 
56  protected:
61  std::vector<Index> _m_domainToActionIndices;
62 
63  public:
64  // Constructor, destructor and copy assignment.
65  // (default) Constructor
66  //PolicyPureVector();
71  Index agentI,
73  size_t depth=MAXHORIZON);
77  virtual ~PolicyPureVector();
78  virtual PolicyPureVector& operator= (const PolicyPureVector& o);
79 
80  //operators:
82  bool operator++ () { return( this->Increment() ); };
83 
85  LIndex GetIndex() const;
86 
88  void SetIndex(LIndex i);
89 
90  //data manipulation (set) functions:
92 
94  void ZeroInitialization();
96  void RandomInitialization();
99  {
100  if(agentI != _m_agentI)
101  throw E("Error, agent index doesn't match.");
103  }
104 
106 
109  bool Increment();
110 
113  void SetDepth(size_t d);
114 
116  void SetAction(Index ohI, Index aI)
117  {_m_domainToActionIndices.at(ohI) = aI;}
118 
119  //get (data) functions:
120 
124  {return( _m_domainToActionIndices[oh] ); }
125 
127  virtual PolicyPureVector* Clone() const
128  { return new PolicyPureVector(*this); }
129 
131  std::string SoftPrint() const;
132 
133 };
134 
135 
136 #endif /* !_POLICYPUREVECTOR_H_ */
137 
138 
139 // Local Variables: ***
140 // mode:c++ ***
141 // End: ***