MultiAgentDecisionProcess  Release 0.2.1
BGIPSolution.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _BGIPSOLUTION_H_
30 #define _BGIPSOLUTION_H_ 1
31 
32 /* the include directives */
33 #include <iostream>
34 #include <set>
35 #include "Globals.h"
36 #include "JointPolicyPureVector.h"
38 
39 //forward declarations:
40 class JPPVValuePair;
41 class PartialJPDPValPair;
42 
45 {
46 private:
47 
51  double _m_payoff;
52 
55 
60 
61  //The set of Indicies of the policies added to the queue
62  //(to avoid adding duplicates).
63  std::set<Index> _m_jpolIndices;
64 
65 protected:
66 
67 public:
68  // Constructor, destructor and copy assignment.
71  size_t nrSolutions=1);
73  ~BGIPSolution();
74 
75  void SetPayoff(double payoff) { _m_payoff=payoff; }
76  double GetPayoff() const { return(_m_payoff); }
77 
78  void SetPolicy(const JointPolicyPureVector &jpol);
79  void SetPolicy(LIndex jpolIndex);
80 
81  const JointPolicy* GetJointPolicy() const { return(_m_policy); }
83  return(*_m_policy); }
85 
86  void Save(std::string filename) const;
87  void Load(std::string filename);
88 
89  void Print() const { std::cout << SoftPrint() << std::endl; }
90  std::string SoftPrint() const;
91 
92  size_t GetNrDesiredSolutions() const {return _m_nrSolutions;};
93  size_t GetNrFoundSolutions() const {return _m_q.size();};
94 
100  void AddSolution(JointPolicyPureVector &jp, double value );
101 
103  void PopNextSolutionJPPV() { _m_q.pop(); };
104  bool IsEmptyJPPV() { return _m_q.empty(); };
105 
106 };
107 
108 
109 #endif /* !_BGIPSOLUTION_H_ */
110 
111 // Local Variables: ***
112 // mode:c++ ***
113 // End: ***