MultiAgentDecisionProcess
Release 0.2.1
Main Page
Namespaces
Classes
Files
File List
File Members
PerseusQFunctionPlanner.cpp
Go to the documentation of this file.
1
28
#include "
PerseusQFunctionPlanner.h
"
29
#include "
PlanningUnitDecPOMDPDiscrete.h
"
30
31
using namespace
std;
32
33
PerseusQFunctionPlanner::
34
PerseusQFunctionPlanner
(
const
PlanningUnitDecPOMDPDiscrete
& pu) :
35
AlphaVectorPlanning
(pu),
36
PerseusStationary
(pu)
37
{
38
}
39
40
//Destructor
41
PerseusQFunctionPlanner::~PerseusQFunctionPlanner
()
42
{
43
}
44
45
void
PerseusQFunctionPlanner::Plan
()
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
54
Q1=
GetInitialQFunctions
();
55
VB=
BeliefValue::GetValues
(*
_m_beliefs
,Q1);
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
70
VBnew=
BeliefValue::GetValues
(*
_m_beliefs
,Q1);
71
72
// test for convergence
73
if
(
CheckConvergence
(VB,VBnew,iter))
74
done=
true
;
75
76
VB=VBnew;
77
iter++;
78
79
PlanEndOfIteration
(Q1);
80
}
81
82
PlanLeadOut
();
83
}
src
planning
PerseusQFunctionPlanner.cpp
Generated on Mon Sep 23 2013 14:50:05 for MultiAgentDecisionProcess by
1.8.1.2