MultiAgentDecisionProcess  Release 0.2.1
PerseusQFunctionPlanner.cpp
Go to the documentation of this file.
1 
30 
31 using namespace std;
32 
37 {
38 }
39 
40 //Destructor
42 {
43 }
44 
46 {
47  PlanLeadIn();
48 
49  QFunctionsDiscrete Q0,Q1;
50  // records the value of each belief in the belief set
51  vector<double> VB,VBnew;
52 
53  // get initial value function
56 
57  int iter=0;
58  bool done=false;
59  while(!done)
60  {
61  // print out some info
62  PlanStartOfIteration(iter,VB,Q1);
63 
64  // the real thing: compute the next stage value function
65  Q0=Q1;
66  Q1=BackupStage(*_m_beliefs,Q0);
67 
68  // compute the maximum difference in the values for all
69  // beliefs: for the convergence test
71 
72  // test for convergence
73  if(CheckConvergence(VB,VBnew,iter))
74  done=true;
75 
76  VB=VBnew;
77  iter++;
78 
80  }
81 
82  PlanLeadOut();
83 }