MultiAgentDecisionProcess  Release 0.2.1
MADPComponentDiscreteStates.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _MADPCOMPONENTDISCRETESTATES_H_
30 #define _MADPCOMPONENTDISCRETESTATES_H_ 1
31 
32 /* the include directives */
33 #include <iostream>
34 #include <vector>
35 #include "Globals.h"
36 
38 #include "StateDiscrete.h"
39 
41 
49  virtual public MultiAgentDecisionProcessDiscreteInterface //which this implements partly
50 {
51  private:
53  size_t _m_nrStates;
54 
56  std::string SoftPrintStates() const;
58  std::string SoftPrintInitialStateDistribution() const;
59 
60  protected:
62  std::vector<StateDiscrete> _m_stateVec;
65 
66  public:
67  // Constructor, destructor and copy assignment.
71  MADPComponentDiscreteStates(size_t nrS);
72 
75 
76  //operators:
77 
78  //data manipulation (set) functions:
80  bool SetInitialized(bool b);
81 
83  void AddState(std::string StateName);
84 
86  void SetNrStates(size_t nrS);
87 
89  void SetUniformISD();
90 
92  void SetISD(StateDistribution* p);
95  void SetISD(std::vector<double> v);
96 
97  //get (data) functions:
99  size_t GetNrStates() const {return _m_nrStates;};
100 
103 
105  Index GetStateIndexByName(std::string s) const;
106 
108  const State* GetState(Index i) const
109  {return(&_m_stateVec.at(i)); }
110 
111  virtual std::string SoftPrintState(Index sI) const
112  { return GetStateName(sI);}
114  std::string GetStateName(Index i) const {
115  return(_m_stateVec.at(i).SoftPrintBrief()); }
116 
118  double GetInitialStateProbability(Index sI) const;
119 
121  //std::vector<double> GetISD() const { return(_m_initialStateDistribution); }
123  { return(_m_initialStateDistribution); }
124  virtual const StateDistribution* GetISD() const
125  { return(_m_initialStateDistribution); }
126 
128  Index SampleInitialState() const;
129 
130  std::string SoftPrint() const;
131  void Print() const
132  {std::cout << SoftPrint();}
133 };
134 
135 
136 #endif /* !_MADPCOMPONENTDISCRETESTATES_H_ */
137 
138 
139 // Local Variables: ***
140 // mode:c++ ***
141 // End: ***