MultiAgentDecisionProcess
Release 0.2.1
|
QFunctionJAOHTree is represents QFunctionJAOH which store Qvalues in a tree. More...
#include <QFunctionJAOHTree.h>
Public Member Functions | |
void | Compute () |
Compute the heuristic. | |
double | GetQ (Index jaohI, Index jaI) const |
Return the Qvalue for JointActionObservationHistory Index jaohI and JointAction index jaI. | |
void | Load (std::string filename) |
Load the Qvalues from disk from a file named filename. | |
QFunctionJAOHTree (const PlanningUnitDecPOMDPDiscrete &pu) | |
Default constructor, requires a planning unit. | |
void | Save (std::string filename) const |
Stores the Qvalues to disk in file named filename. | |
void | SetPU (const PlanningUnitDecPOMDPDiscrete &pu) |
virtual | ~QFunctionJAOHTree () |
Destructor. | |
![]() | |
void | ComputeWithCachedQValues () |
Destructor. | |
QFunctionJAOH (const PlanningUnitDecPOMDPDiscrete &pu) | |
Default constructor, requires a planning unit. | |
![]() | |
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. | |
![]() | |
QFunctionForDecPOMDPInterface () | |
(default) Constructor | |
virtual | ~QFunctionForDecPOMDPInterface () |
Destructor. | |
![]() | |
virtual | ~QFunctionInterface () |
Compute the heuristic. | |
![]() | |
const PlanningUnitDecPOMDPDiscrete * | GetPU () const |
QFunctionForDecPOMDP (const PlanningUnitDecPOMDPDiscrete &pu) | |
(default) Constructor |
Private Member Functions | |
void | ComputeQ () |
This function starts the recursive computing of Qvalues. | |
virtual double | ComputeRecursively (size_t time_step, JointActionObservationHistoryTree *jaoht, Index lastJAI)=0 |
Recursively compute Qvalues based on a particular JOAHTree. | |
void | DeInitialize () |
void | Initialize () |
Private Attributes | |
bool | _m_initialized |
Additional Inherited Members | |
![]() | |
virtual void | ComputeWithCachedQValues (std::string filenameCache) |
See ComputeWithCachedQValuesdQValues(), this version accepts a filename. | |
![]() | |
QTable | _m_QValues |
Table in which the Qvalues are stored. |
QFunctionJAOHTree is represents QFunctionJAOH which store Qvalues in a tree.
Definition at line 38 of file QFunctionJAOHTree.h.
QFunctionJAOHTree::QFunctionJAOHTree | ( | const PlanningUnitDecPOMDPDiscrete & | pu | ) |
Default constructor, requires a planning unit.
Definition at line 41 of file QFunctionJAOHTree.cpp.
References _m_initialized.
|
virtual |
|
virtual |
Compute the heuristic.
(after associated with an initialized PlanningUnitDecPOMDPDiscrete)
Implements QFunctionInterface.
Definition at line 74 of file QFunctionJAOHTree.cpp.
References _m_initialized, ComputeQ(), and Initialize().
|
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.
Definition at line 95 of file QFunctionJAOHTree.cpp.
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).
Referenced by ComputeQ().
|
private |
Definition at line 54 of file QFunctionJAOHTree.cpp.
References _m_initialized, and QFunctionJAOH::_m_QValues.
Referenced by SetPU(), and ~QFunctionJAOHTree().
|
inlinevirtual |
Return the Qvalue for JointActionObservationHistory Index jaohI and JointAction index jaI.
Implements QFunctionJAOHInterface.
Definition at line 85 of file QFunctionJAOHTree.h.
References QFunctionJAOH::_m_QValues.
|
private |
Definition at line 60 of file QFunctionJAOHTree.cpp.
References _m_initialized, QFunctionJAOH::_m_QValues, and QFunctionForDecPOMDP::GetPU().
Referenced by Compute().
|
virtual |
Load the Qvalues from disk from a file named filename.
Reimplemented from QFunctionJAOHInterface.
Definition at line 87 of file QFunctionJAOHTree.cpp.
References QFunctionJAOH::_m_QValues, QFunctionForDecPOMDP::GetPU(), and MDPSolver::LoadQTable().
|
virtual |
Stores the Qvalues to disk in file named filename.
Reimplemented from QFunctionJAOHInterface.
Definition at line 82 of file QFunctionJAOHTree.cpp.
References QFunctionJAOH::_m_QValues, and MDPSolver::SaveQTable().
|
virtual |
Reimplemented from QFunctionForDecPOMDP.
Definition at line 68 of file QFunctionJAOHTree.cpp.
References DeInitialize().
|
private |
Definition at line 42 of file QFunctionJAOHTree.h.
Referenced by Compute(), DeInitialize(), Initialize(), and QFunctionJAOHTree().