MultiAgentDecisionProcess
|
QMDP is a class that represents the QMDP heuristic. More...
#include <QMDP.h>
Public Member Functions | |
void | Compute () |
Compute the heuristic. More... | |
void | ComputeWithCachedQValues (const std::string &filename, bool computeIfNotCached=true) |
See ComputeWithCachedQValues(), this version accepts a filename. More... | |
double | GetQ (Index jaohI, Index jaI) const |
Returns Q(joint A-O history jaohI, jaI). More... | |
double | GetQ (const JointBeliefInterface &b, Index jaI) const |
Returns Q(b, jaI). More... | |
double | GetQ (const JointBeliefInterface &b, Index time_step, Index jaI) const |
Returns Q(b, jaI) for a particular time_step. More... | |
double | GetQNoCache (Index jaohI, Index jaI) const |
Return the Qvalue for JointActionObservationHistory Index jaohI and JointAction index jaI. More... | |
double | GetQSA (Index t, Index sI, Index jaI) const |
void | Load (const std::string &filename) |
Load the Qvalues from disk from a file named filename. More... | |
QMDP (const PlanningUnitDecPOMDPDiscrete *pu, bool useJaohQValuesCache=false) | |
(default) Constructor More... | |
QMDP (const boost::shared_ptr< const PlanningUnitDecPOMDPDiscrete > &pu, bool useJaohQValuesCache=false) | |
void | Save (const std::string &filename) const |
Stores the Qvalues to disk in file named filename. More... | |
void | SetPU (const PlanningUnitDecPOMDPDiscrete *pu) |
void | SetPU (const boost::shared_ptr< const PlanningUnitDecPOMDPDiscrete > &pu) |
std::string | SoftPrintBrief () const |
Returns a short description of the heuristic, can be used for constructing filenames. More... | |
~QMDP () | |
Destructor. More... | |
Public Member Functions inherited from QFunctionJAOH | |
virtual void | ComputeWithCachedQValues (bool computeIfNotCached=true) |
Compute Qvalue function, while caching the Qvalues to disk. More... | |
QFunctionJAOH (const PlanningUnitDecPOMDPDiscrete *pu) | |
Default constructor, requires a planning unit. More... | |
QFunctionJAOH (const boost::shared_ptr< const PlanningUnitDecPOMDPDiscrete > &pu) | |
virtual | ~QFunctionJAOH () |
Destructor. More... | |
Public Member Functions inherited from QFunctionJAOHInterface | |
QFunctionJAOHInterface () | |
virtual | ~QFunctionJAOHInterface () |
Destructor. More... | |
Public Member Functions inherited from QFunctionForDecPOMDPInterface | |
QFunctionForDecPOMDPInterface () | |
(default) Constructor More... | |
virtual | ~QFunctionForDecPOMDPInterface () |
Destructor. More... | |
Public Member Functions inherited from QFunctionInterface | |
virtual void | Load () |
Load the Qvalues from disk. More... | |
virtual void | Save () const |
Stores the Qvalues to disk. More... | |
virtual | ~QFunctionInterface () |
Public Member Functions inherited from QFunctionForDecPOMDP | |
virtual std::string | GetCacheFilename () const |
Gets the filename where the Qvalues should be stored. More... | |
const PlanningUnitDecPOMDPDiscrete * | GetPU () const |
QFunctionForDecPOMDP (const PlanningUnitDecPOMDPDiscrete *pu) | |
(default) Constructor More... | |
QFunctionForDecPOMDP (const boost::shared_ptr< const PlanningUnitDecPOMDPDiscrete > &pu) | |
Public Member Functions inherited from QFunctionJointBeliefInterface | |
QFunctionJointBeliefInterface () | |
(default) Constructor More... | |
virtual | ~QFunctionJointBeliefInterface () |
Destructor. More... | |
Private Member Functions | |
void | CacheJaohQValues () |
void | DeInitialize () |
void | Initialize () |
Private Attributes | |
bool | _m_initialized |
MDPSolver * | _m_p |
bool | _m_useJaohQValuesCache |
Additional Inherited Members | |
Protected Attributes inherited from QFunctionJAOH | |
QTable | _m_QValues |
Table in which the Qvalues are stored. More... | |
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 |
||
) |
(default) Constructor
QMDP::QMDP | ( | const boost::shared_ptr< const PlanningUnitDecPOMDPDiscrete > & | pu, |
bool | useJaohQValuesCache = false |
||
) |
QMDP::~QMDP | ( | ) |
Destructor.
References DeInitialize().
|
private |
References _m_p, QFunctionJAOH::_m_QValues, PlanningUnitMADPDiscrete::GetNrJointActionObservationHistories(), PlanningUnitMADPDiscrete::GetNrJointActions(), QFunctionForDecPOMDP::GetPU(), MDPSolver::GetQ(), and PlanningUnitMADPDiscrete::GetTimeStepForJAOHI().
Referenced by Compute(), and ComputeWithCachedQValues().
|
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.
References _m_initialized, _m_p, _m_useJaohQValuesCache, CacheJaohQValues(), Initialize(), and MDPSolver::Plan().
Referenced by FactoredQLastTimeStepOrQMDP::Compute(), and AlphaVectorPlanning::SampleBeliefs().
|
virtual |
See ComputeWithCachedQValues(), this version accepts a filename.
Reimplemented from QFunctionJAOH.
References _m_initialized, _m_p, _m_useJaohQValuesCache, CacheJaohQValues(), Initialize(), and MDPSolver::PlanWithCache().
|
private |
References _m_initialized, _m_p, and QFunctionJAOH::_m_QValues.
Returns Q(joint A-O history jaohI, jaI).
Implements QFunctionJAOHInterface.
References QFunctionJAOH::_m_QValues, and GetQNoCache().
Referenced by FactoredQLastTimeStepOrQMDP::GetQ(), and AlphaVectorPlanning::SampleBeliefs().
|
inlinevirtual |
|
inlinevirtual |
Returns Q(b, jaI) for a particular time_step.
Implements QFunctionJointBeliefInterface.
References MDPSolver::GetQ().
Return the Qvalue for JointActionObservationHistory Index jaohI and JointAction index jaI.
References _m_p, PlanningUnitMADPDiscrete::GetJointBeliefInterface(), QFunctionForDecPOMDP::GetPU(), MDPSolver::GetQ(), and PlanningUnitMADPDiscrete::GetTimeStepForJAOHI().
Referenced by GetQ().
References MDPSolver::GetQ().
|
private |
References _m_initialized, _m_p, QFunctionJAOH::_m_QValues, _m_useJaohQValuesCache, and QFunctionForDecPOMDP::GetPU().
Referenced by Compute(), ComputeWithCachedQValues(), and Load().
|
virtual |
Load the Qvalues from disk from a file named filename.
Implements QFunctionInterface.
References _m_initialized, _m_p, QFunctionJAOH::_m_QValues, _m_useJaohQValuesCache, QFunctionForDecPOMDP::GetPU(), Initialize(), QTable::Load(), and MDPSolver::SetQTables().
|
virtual |
Stores the Qvalues to disk in file named filename.
Implements QFunctionInterface.
References _m_p, QFunctionJAOH::_m_QValues, _m_useJaohQValuesCache, MDPSolver::GetQTables(), and QTable::Save().
|
virtual |
Reimplemented from QFunctionForDecPOMDP.
References DeInitialize(), and QFunctionForDecPOMDP::SetPU().
|
virtual |
Reimplemented from QFunctionForDecPOMDP.
References DeInitialize(), and QFunctionForDecPOMDP::SetPU().
|
inlinevirtual |
Returns a short description of the heuristic, can be used for constructing filenames.
Implements QFunctionInterface.
|
private |
Referenced by Compute(), ComputeWithCachedQValues(), DeInitialize(), Initialize(), and Load().
|
private |
Referenced by CacheJaohQValues(), Compute(), ComputeWithCachedQValues(), DeInitialize(), GetQNoCache(), Initialize(), Load(), and Save().
|
private |
Referenced by Compute(), ComputeWithCachedQValues(), Initialize(), Load(), and Save().