MultiAgentDecisionProcess
Release 0.2.1
|
QMDP is a class that represents the QMDP heuristic. More...
#include <QMDP.h>
Public Member Functions | |
void | Compute () |
Compute the heuristic. | |
double | GetQ (Index jaohI, Index jaI) const |
Returns Q(joint A-O history jaohI, jaI). | |
double | GetQ (const JointBeliefInterface &b, Index jaI) const |
Returns Q(b, jaI). | |
double | GetQ (const JointBeliefInterface &b, Index time_step, Index jaI) const |
Returns Q(b, jaI) for a particular time_step. | |
double | GetQNoCache (Index jaohI, Index jaI) const |
Return the Qvalue for JointActionObservationHistory Index jaohI and JointAction index jaI. | |
double | GetQSA (Index t, Index sI, Index jaI) const |
void | Load (std::string filename) |
Load the Qvalues from disk from a file named filename. | |
QMDP (const PlanningUnitDecPOMDPDiscrete &pu, bool useJaohQValuesCache=false) | |
(default) Constructor | |
void | Save (std::string filename) const |
Stores the Qvalues to disk in file named filename. | |
void | SetPU (const PlanningUnitDecPOMDPDiscrete &pu) |
~QMDP () | |
Destructor. | |
![]() | |
void | ComputeWithCachedQValues () |
Destructor. | |
QFunctionJAOH (const PlanningUnitDecPOMDPDiscrete &pu) | |
Default constructor, requires a planning unit. | |
![]() | |
virtual std::string | GetCacheFilename () const |
Gets the filename where the Qvalues should be stored. | |
void | Load () |
Load the Qvalues from disk. | |
QFunctionJAOHInterface () | |
void | Save () const |
Stores the Qvalues to disk. | |
virtual | ~QFunctionJAOHInterface () |
Destructor. | |
![]() | |
QFunctionForDecPOMDPInterface () | |
(default) Constructor | |
virtual | ~QFunctionForDecPOMDPInterface () |
Destructor. | |
![]() | |
virtual | ~QFunctionInterface () |
Compute the heuristic. | |
![]() | |
const PlanningUnitDecPOMDPDiscrete * | GetPU () const |
QFunctionForDecPOMDP (const PlanningUnitDecPOMDPDiscrete &pu) | |
(default) Constructor | |
![]() | |
QFunctionJointBeliefInterface () | |
(default) Constructor | |
virtual | ~QFunctionJointBeliefInterface () |
Destructor. |
Private Member Functions | |
void | CacheJaohQValues () |
void | DeInitialize () |
void | Initialize () |
Private Attributes | |
bool | _m_initialized |
MDPSolver * | _m_p |
bool | _m_useJaohQValuesCache |
Additional Inherited Members | |
![]() | |
virtual void | ComputeWithCachedQValues (std::string filenameCache) |
See ComputeWithCachedQValuesdQValues(), this version accepts a filename. | |
![]() | |
QTable | _m_QValues |
Table in which the Qvalues are stored. |
QMDP is a class that represents the QMDP heuristic.
It is associated with a PlanningUnitDecPOMDPDiscrete which it uses for things as horizon, action-/observation(history) indices, etc. *
QMDP::QMDP | ( | const PlanningUnitDecPOMDPDiscrete & | pu, |
bool | useJaohQValuesCache = false |
||
) |
QMDP::~QMDP | ( | ) |
|
private |
Definition at line 87 of file QMDP.cpp.
References _m_p, QFunctionJAOH::_m_QValues, PlanningUnitMADPDiscrete::GetJointActionObservationHistoryTree(), JointActionObservationHistoryTree::GetLength(), PlanningUnitMADPDiscrete::GetNrJointActionObservationHistories(), PlanningUnitMADPDiscrete::GetNrJointActions(), QFunctionForDecPOMDP::GetPU(), and MDPSolver::GetQ().
Referenced by Compute().
|
virtual |
Compute the heuristic.
(after associated with an initialized PlanningUnitDecPOMDPDiscrete).
Note: unlike QBG and QPOMDP, the QMDP heuristic can be computed without access to JointActionObservationHistory (Indices) and JointBeliefs. So there is only 1 compute version. However in order to get the Q for a particular JointActionObservationHistory (Index) this information is needed. Therefore there are multiple GetQ functions for this class.
Implements QFunctionInterface.
Definition at line 76 of file QMDP.cpp.
References _m_initialized, _m_p, _m_useJaohQValuesCache, CacheJaohQValues(), Initialize(), and MDPSolver::Plan().
Referenced by AlphaVectorPlanning::SampleBeliefs().
|
private |
Definition at line 63 of file QMDP.cpp.
References _m_initialized, _m_p, and QFunctionJAOH::_m_QValues.
|
inlinevirtual |
Returns Q(joint A-O history jaohI, jaI).
Implements QFunctionJAOHInterface.
Definition at line 90 of file QMDP.h.
References QFunctionJAOH::_m_QValues, _m_useJaohQValuesCache, and GetQNoCache().
Referenced by AlphaVectorPlanning::SampleBeliefs().
|
virtual |
Returns Q(b, jaI).
Implements QFunctionJointBeliefInterface.
Definition at line 118 of file QMDP.cpp.
References _m_p, and MDPSolver::GetQ().
|
virtual |
Returns Q(b, jaI) for a particular time_step.
Implements QFunctionJointBeliefInterface.
Definition at line 123 of file QMDP.cpp.
References _m_p, and MDPSolver::GetQ().
double QMDP::GetQNoCache | ( | Index | jaohI, |
Index | jaI | ||
) | const |
Return the Qvalue for JointActionObservationHistory Index jaohI and JointAction index jaI.
Definition at line 101 of file QMDP.cpp.
References _m_p, PlanningUnitMADPDiscrete::GetJointBeliefInterface(), QFunctionForDecPOMDP::GetPU(), MDPSolver::GetQ(), and PlanningUnitMADPDiscrete::GetTimeStepForJAOHI().
Referenced by GetQ().
double QMDP::GetQSA | ( | Index | t, |
Index | sI, | ||
Index | jaI | ||
) | const |
Definition at line 112 of file QMDP.cpp.
References _m_p, and MDPSolver::GetQ().
|
private |
Definition at line 51 of file QMDP.cpp.
References _m_initialized, _m_p, QFunctionJAOH::_m_QValues, _m_useJaohQValuesCache, and QFunctionForDecPOMDP::GetPU().
Referenced by Compute().
|
virtual |
Load the Qvalues from disk from a file named filename.
Reimplemented from QFunctionJAOHInterface.
Definition at line 137 of file QMDP.cpp.
References _m_p, QFunctionJAOH::_m_QValues, _m_useJaohQValuesCache, QFunctionForDecPOMDP::GetPU(), MDPSolver::LoadQTable(), MDPSolver::LoadQTables(), and MDPSolver::SetQTables().
|
virtual |
Stores the Qvalues to disk in file named filename.
Reimplemented from QFunctionJAOHInterface.
Definition at line 129 of file QMDP.cpp.
References _m_p, QFunctionJAOH::_m_QValues, _m_useJaohQValuesCache, MDPSolver::GetQTables(), MDPSolver::SaveQTable(), and MDPSolver::SaveQTables().
|
virtual |
Reimplemented from QFunctionForDecPOMDP.
Definition at line 70 of file QMDP.cpp.
References DeInitialize().
|
private |
Definition at line 52 of file QMDP.h.
Referenced by Compute(), DeInitialize(), and Initialize().
|
private |
Definition at line 50 of file QMDP.h.
Referenced by CacheJaohQValues(), Compute(), DeInitialize(), GetQ(), GetQNoCache(), GetQSA(), Initialize(), Load(), and Save().
|
private |