MultiAgentDecisionProcess
|
QFunctionJAOHTree is represents QFunctionJAOH which store Qvalues in a tree. More...
#include <QFunctionJAOHTree.h>
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... | |
QFunctionJAOHTree is represents QFunctionJAOH which store Qvalues in a tree.
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.
|
virtual |
Destructor.
References DeInitialize().
|
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().
|
private |
This function starts the recursive computing of Qvalues.
A lot of Q-value functions are computed in a similar, recursive way. (In particular QPOMDP and QBG)
This function starts this calculation.
Classes that use this function have to define (reimplement) ComputeRecursively.
References QFunctionJAOH::_m_QValues, ComputeRecursively(), DEBUG_QHEUR_COMP_TREE, BeliefInterface::Get(), PlanningUnitDecPOMDPDiscrete::GetDiscount(), BeliefInterface::GetIterator(), PlanningUnitMADPDiscrete::GetNewJointBeliefFromISD(), PlanningUnitMADPDiscrete::GetNrAgents(), PlanningUnitMADPDiscrete::GetNrJointActions(), PlanningUnitMADPDiscrete::GetNrStates(), BeliefIteratorGeneric::GetProbability(), QFunctionForDecPOMDP::GetPU(), PlanningUnitDecPOMDPDiscrete::GetReward(), BeliefIteratorGeneric::GetStateIndex(), Globals::INITIAL_JAOHI, BeliefIteratorGeneric::Next(), BeliefInterface::Print(), and BGIP_SolverBruteForceSearch< JP >::Solve().
Referenced by Compute().
|
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().
|
private |
References _m_initialized, and QFunctionJAOH::_m_QValues.
Referenced by SetPU(), and ~QFunctionJAOHTree().
Return the Qvalue for JointActionObservationHistory Index jaohI and JointAction index jaI.
Implements QFunctionJAOHInterface.
References QFunctionJAOH::_m_QValues.
Referenced by FactoredQLastTimeStepOrQBG::GetQ(), and FactoredQLastTimeStepOrQPOMDP::GetQ().
|
private |
References _m_initialized, QFunctionJAOH::_m_QValues, and QFunctionForDecPOMDP::GetPU().
|
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().
|
virtual |
Stores the Qvalues to disk in file named filename.
Implements QFunctionInterface.
References QFunctionJAOH::_m_QValues, and QTable::Save().
|
virtual |
Reimplemented from QFunctionForDecPOMDP.
References DeInitialize(), and QFunctionForDecPOMDP::SetPU().
|
virtual |
Reimplemented from QFunctionForDecPOMDP.
References DeInitialize(), and QFunctionForDecPOMDP::SetPU().
|
private |
Referenced by Compute(), DeInitialize(), Initialize(), Load(), and QFunctionJAOHTree().