MultiAgentDecisionProcess
QMDP Class Reference

QMDP is a class that represents the QMDP heuristic. More...

#include <QMDP.h>

Inheritance diagram for QMDP:
[legend]

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...
 

Detailed Description

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. *

Constructor & Destructor Documentation

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().

Member Function Documentation

void QMDP::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.

References _m_initialized, _m_p, _m_useJaohQValuesCache, CacheJaohQValues(), Initialize(), and MDPSolver::Plan().

Referenced by FactoredQLastTimeStepOrQMDP::Compute(), and AlphaVectorPlanning::SampleBeliefs().

void QMDP::ComputeWithCachedQValues ( const std::string &  filenameCache,
bool  computeIfNotCached = true 
)
virtual
void QMDP::DeInitialize ( )
private

References _m_initialized, _m_p, and QFunctionJAOH::_m_QValues.

Referenced by SetPU(), and ~QMDP().

double QMDP::GetQ ( Index  jaohI,
Index  jaI 
) const
inlinevirtual

Returns Q(joint A-O history jaohI, jaI).

Implements QFunctionJAOHInterface.

References QFunctionJAOH::_m_QValues, and GetQNoCache().

Referenced by FactoredQLastTimeStepOrQMDP::GetQ(), and AlphaVectorPlanning::SampleBeliefs().

double QMDP::GetQ ( const JointBeliefInterface b,
Index  jaI 
) const
inlinevirtual

Returns Q(b, jaI).

Implements QFunctionJointBeliefInterface.

References MDPSolver::GetQ().

double QMDP::GetQ ( const JointBeliefInterface b,
Index  time_step,
Index  jaI 
) const
inlinevirtual

Returns Q(b, jaI) for a particular time_step.

Implements QFunctionJointBeliefInterface.

References MDPSolver::GetQ().

double QMDP::GetQNoCache ( Index  jaohI,
Index  jaI 
) const
double QMDP::GetQSA ( Index  t,
Index  sI,
Index  jaI 
) const
inline

References MDPSolver::GetQ().

void QMDP::Load ( const std::string &  filename)
virtual
void QMDP::Save ( const std::string &  filename) const
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().

void QMDP::SetPU ( const PlanningUnitDecPOMDPDiscrete pu)
virtual
void QMDP::SetPU ( const boost::shared_ptr< const PlanningUnitDecPOMDPDiscrete > &  pu)
virtual
std::string QMDP::SoftPrintBrief ( ) const
inlinevirtual

Returns a short description of the heuristic, can be used for constructing filenames.

Implements QFunctionInterface.

Member Data Documentation

bool QMDP::_m_initialized
private
bool QMDP::_m_useJaohQValuesCache
private