MultiAgentDecisionProcess  Release 0.2.1
PerseusStationary.cpp
Go to the documentation of this file.
1 
28 #include "PerseusStationary.h"
29 #include "argumentHandlers.h"
30 
31 using namespace std;
32 
33 //Default constructor
36  Perseus(pu)
37 {
38 }
39 
40 //Destructor
42 {
44  delete(_m_beliefs);
45 }
46 
48 {
49  return(BeliefValue::GetValue(b,_m_qFunction[jaI]));
50 }
51 
53  int &betaMaxI) const
54 {
55  Index maxI=BeliefValue::
57  betaMaxI=_m_qFunction[jaI][maxI].GetBetaI();
58  return(b.InnerProduct(_m_qFunction[jaI][maxI].GetValues()));
59 }
60 
62  Index jaI) const
63 {
64  throw(E("PerseusStationary::GetQ not implemented for non-stationary case"));
65  return(42);
66 }
67 
69  Index jaI, int &betaMaxI) const
70 {
71  throw(E("PerseusStationary::GetQ not implemented for non-stationary case"));
72  return(42);
73 }
74 
78 {
80  delete(_m_beliefs);
81  _m_beliefs=new BeliefSet(S);
83 }
84 
85 void PerseusStationary::ExportBeliefSet(const string &filename) const
86 {
88  {
89  cout << "PerseusStationary::ExportBeliefSet: belief set not set"
90  << endl;
91  }
92  else
94 }
95 
97 void PerseusStationary::ExportValueFunction(const string &filename) const
98 {
100 }
101 
103 {
107 }
108 
110 void PerseusStationary::SetValueFunction(const string &filename)
111 {
115  GetPU()->GetNrJointActions(),
116  GetPU()->GetNrStates());
117 }
118 
119 void PerseusStationary::InitializeBeliefs(int nrB, bool uniquify)
120 {
122  args.nrBeliefs=nrB;
123  args.uniqueBeliefs=uniquify;
125 }
126 
128 {
129  // store the resulting value function
131  // compute the Q functions from the value function
133 }
134 
136 {
137  // store the resulting Q function and the value function
138  _m_qFunction=Q;
139  _m_valueFunction.clear();
140  for(QFDcit i=Q.begin();i!=Q.end();++i)
141  for(VFPDcit j=i->begin();j!=i->end();++j)
142  if(j->GetAction()!=INT_MAX)
143  _m_valueFunction.push_back(*j);
144 }