MultiAgentDecisionProcess  Release 0.2.1
BayesianGameIdenticalPayoff.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _BAYESIANGAMEIDENTICALPAYOFF_H_
30 #define _BAYESIANGAMEIDENTICALPAYOFF_H_ 1
31 
32 /* the include directives */
33 #include <iostream>
34 #include <vector>
35 #include "Globals.h"
36 #include "RewardModelMapping.h"
37 #include "BayesianGameBase.h"
39 
51  //virtual
52  //public BayesianGameBase,
53  //virtual
55 {
56  private:
57 
63 
68 
69  protected:
70 
71  public:
72  // Constructor, destructor and copy assignment.
73  // (default) Constructor
75  BayesianGameIdenticalPayoff(size_t nrAgents,
76  const std::vector<size_t>& nrActions,
77  const std::vector<size_t>& nrTypes);
79  //~BayesianGameIdenticalPayoff();
80  //operators:
81 
82  //data manipulation (set) functions:
83 
86  bool SetInitialized(bool b);
88  void SetUtility(const Index jtype, const Index ja, const double u )
89  {_m_utilFunction.Set(jtype,ja,u);}
93  void SetUtility(const std::vector<Index>& indTypeIndices,
94  const std::vector<Index>& indActionIndices,const double u )
96  IndividualToJointTypeIndices(indTypeIndices),
97  IndividualToJointActionIndices(indActionIndices),
98  u);}
99 
100  //get (data) functions:
102  double GetUtility(const Index jtype, const Index ja) const
103  {return(_m_utilFunction.Get(jtype,ja));}
107  double GetUtility(const std::vector<Index>& indTypeIndices,
108  const std::vector<Index>& indActionIndices ) const
109  {return(_m_utilFunction.Get(
110  IndividualToJointTypeIndices(indTypeIndices),
111  IndividualToJointActionIndices(indActionIndices) ));}
114  std::string SoftPrint() const;
116  void Print() const
117  { std::cout << SoftPrint();}
119  std::string SoftPrintUtilForJointType(Index jtype) const;
122  void PrintUtilForJointType(Index jtype) const
123  {std::cout << SoftPrintUtilForJointType(jtype);}
124 
125  static void Save(const BayesianGameIdenticalPayoff &bg,
126  std::string filename);
127 
129 
133  static BayesianGameIdenticalPayoff Load(std::string filename);
135 
140  size_t nrAgents,
141  std::vector<size_t> acs,
142  std::vector<size_t> obs
143  );
144 };
145 
146 
147 #endif /* !_BAYESIANGAMEIDENTICALPAYOFF_H_ */
148 
149 // Local Variables: ***
150 // mode:c++ ***
151 // End: ***