MultiAgentDecisionProcess  Release 0.2.1
QMDP Class Reference

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

#include <QMDP.h>

+ Inheritance diagram for QMDP:
+ Collaboration diagram for QMDP:

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.
- Public Member Functions inherited from QFunctionJAOH
void ComputeWithCachedQValues ()
 Destructor.
 QFunctionJAOH (const PlanningUnitDecPOMDPDiscrete &pu)
 Default constructor, requires a planning unit.
- Public Member Functions inherited from QFunctionJAOHInterface
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.
- Public Member Functions inherited from QFunctionForDecPOMDPInterface
 QFunctionForDecPOMDPInterface ()
 (default) Constructor
virtual ~QFunctionForDecPOMDPInterface ()
 Destructor.
- Public Member Functions inherited from QFunctionInterface
virtual ~QFunctionInterface ()
 Compute the heuristic.
- Public Member Functions inherited from QFunctionForDecPOMDP
const
PlanningUnitDecPOMDPDiscrete
GetPU () const
 QFunctionForDecPOMDP (const PlanningUnitDecPOMDPDiscrete &pu)
 (default) Constructor
- Public Member Functions inherited from QFunctionJointBeliefInterface
 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

- Protected Member Functions inherited from QFunctionJAOH
virtual void ComputeWithCachedQValues (std::string filenameCache)
 See ComputeWithCachedQValuesdQValues(), this version accepts a filename.
- Protected Attributes inherited from QFunctionJAOH
QTable _m_QValues
 Table in which the Qvalues are stored.

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

Definition at line 45 of file QMDP.h.

Constructor & Destructor Documentation

QMDP::QMDP ( const PlanningUnitDecPOMDPDiscrete pu,
bool  useJaohQValuesCache = false 
)

(default) Constructor

Definition at line 36 of file QMDP.cpp.

QMDP::~QMDP ( )

Destructor.

Definition at line 46 of file QMDP.cpp.

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.

Definition at line 76 of file QMDP.cpp.

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

Referenced by AlphaVectorPlanning::SampleBeliefs().

void QMDP::DeInitialize ( )
private

Definition at line 63 of file QMDP.cpp.

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.

Definition at line 90 of file QMDP.h.

References QFunctionJAOH::_m_QValues, _m_useJaohQValuesCache, and GetQNoCache().

Referenced by AlphaVectorPlanning::SampleBeliefs().

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

Returns Q(b, jaI).

Implements QFunctionJointBeliefInterface.

Definition at line 118 of file QMDP.cpp.

References _m_p, and MDPSolver::GetQ().

double QMDP::GetQ ( const JointBeliefInterface b,
Index  time_step,
Index  jaI 
) const
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
double QMDP::GetQSA ( Index  t,
Index  sI,
Index  jaI 
) const

Definition at line 112 of file QMDP.cpp.

References _m_p, and MDPSolver::GetQ().

void QMDP::Initialize ( )
private
void QMDP::Load ( std::string  filename)
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().

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

void QMDP::SetPU ( const PlanningUnitDecPOMDPDiscrete pu)
virtual

Reimplemented from QFunctionForDecPOMDP.

Definition at line 70 of file QMDP.cpp.

References DeInitialize().

Member Data Documentation

bool QMDP::_m_initialized
private

Definition at line 52 of file QMDP.h.

Referenced by Compute(), DeInitialize(), and Initialize().

MDPSolver* QMDP::_m_p
private

Definition at line 50 of file QMDP.h.

Referenced by CacheJaohQValues(), Compute(), DeInitialize(), GetQ(), GetQNoCache(), GetQSA(), Initialize(), Load(), and Save().

bool QMDP::_m_useJaohQValuesCache
private

Definition at line 52 of file QMDP.h.

Referenced by Compute(), GetQ(), Initialize(), Load(), and Save().


The documentation for this class was generated from the following files: