MultiAgentDecisionProcess
QFunctionJAOHTree Class Referenceabstract

QFunctionJAOHTree is represents QFunctionJAOH which store Qvalues in a tree. More...

#include <QFunctionJAOHTree.h>

Inheritance diagram for QFunctionJAOHTree:
[legend]

Public Member Functions

void Compute ()
 Compute the heuristic. More...
 
double GetQ (Index jaohI, Index jaI) const
 Return the Qvalue for JointActionObservationHistory Index jaohI and JointAction index jaI. More...
 
void Load (const std::string &filename)
 Load the Qvalues from disk from a file named filename. More...
 
 QFunctionJAOHTree (const PlanningUnitDecPOMDPDiscrete *pu)
 Default constructor, requires a planning unit. More...
 
 QFunctionJAOHTree (const boost::shared_ptr< const PlanningUnitDecPOMDPDiscrete > &pu)
 
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)
 
virtual ~QFunctionJAOHTree ()
 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 std::string SoftPrintBrief () const =0
 Returns a short description of the heuristic, can be used for constructing filenames. 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)
 

Private Member Functions

void ComputeQ ()
 This function starts the recursive computing of Qvalues. More...
 
virtual double ComputeRecursively (size_t time_step, LIndex jaohI, Index lastJAI)=0
 Recursively compute Qvalues based on a particular JOAHTree. More...
 
void DeInitialize ()
 
void Initialize ()
 

Private Attributes

bool _m_initialized
 

Additional Inherited Members

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

Detailed Description

QFunctionJAOHTree is represents QFunctionJAOH which store Qvalues in a tree.

Constructor & Destructor Documentation

QFunctionJAOHTree::QFunctionJAOHTree ( const PlanningUnitDecPOMDPDiscrete pu)

Default constructor, requires a planning unit.

References _m_initialized.

QFunctionJAOHTree::QFunctionJAOHTree ( const boost::shared_ptr< const PlanningUnitDecPOMDPDiscrete > &  pu)

References _m_initialized.

QFunctionJAOHTree::~QFunctionJAOHTree ( )
virtual

Destructor.

References DeInitialize().

Member Function Documentation

void QFunctionJAOHTree::Compute ( )
virtual

Compute the heuristic.

(after associated with an initialized PlanningUnitDecPOMDPDiscrete)

Implements QFunctionInterface.

References _m_initialized, ComputeQ(), and Initialize().

Referenced by FactoredQLastTimeStepOrQBG::Compute(), and FactoredQLastTimeStepOrQPOMDP::Compute().

virtual double QFunctionJAOHTree::ComputeRecursively ( size_t  time_step,
LIndex  jaohI,
Index  lastJAI 
)
privatepure virtual

Recursively compute Qvalues based on a particular JOAHTree.

Function that should be reimplemented by derived classes that use ComputeQ() (e.g., QPOMDP, QBG).

Implemented in QBG, and QPOMDP.

Referenced by ComputeQ().

void QFunctionJAOHTree::DeInitialize ( )
private
double QFunctionJAOHTree::GetQ ( Index  jaohI,
Index  jaI 
) const
inlinevirtual
void QFunctionJAOHTree::Initialize ( )
private
void QFunctionJAOHTree::Load ( const std::string &  filename)
virtual

Load the Qvalues from disk from a file named filename.

Implements QFunctionInterface.

References _m_initialized, QFunctionJAOH::_m_QValues, QFunctionForDecPOMDP::GetPU(), Initialize(), QTable::Load(), and MDPSolver::LoadQTable().

void QFunctionJAOHTree::Save ( const std::string &  filename) const
virtual

Stores the Qvalues to disk in file named filename.

Implements QFunctionInterface.

References QFunctionJAOH::_m_QValues, and QTable::Save().

void QFunctionJAOHTree::SetPU ( const PlanningUnitDecPOMDPDiscrete pu)
virtual
void QFunctionJAOHTree::SetPU ( const boost::shared_ptr< const PlanningUnitDecPOMDPDiscrete > &  pu)
virtual

Member Data Documentation

bool QFunctionJAOHTree::_m_initialized
private