MultiAgentDecisionProcess
|
JointActionObservationHistoryTree is derived from TreeNode, and similar to ObservationHistoryTree: More...
#include <JointActionObservationHistoryTree.h>
Public Member Functions | |
JointActionObservationHistory * | GetJointActionObservationHistory () const |
Returns the contained JointActionObservationHistory*. More... | |
size_t | GetLength () const |
Returns the length of the containted JointActionObservationHistory. More... | |
JointActionObservationHistoryTree * | GetPredecessor () const |
Returns the predecessor JointActionObservationHistoryTree*. More... | |
JointActionObservationHistoryTree * | GetSuccessor (Index jaI, Index joI) |
Returns the successor JointActionObservationHistoryTree* for joint action jaI and joint observation joI. More... | |
JointActionObservationHistoryTree (aoh_t nt=A_SUC) | |
(default) Constructor More... | |
JointActionObservationHistoryTree (JointActionObservationHistory *const aoh, aoh_t nt=A_SUC) | |
Create a joint observation history tree for joh. More... | |
void | Print () const |
void | SetIndex (LIndex i) |
Sets the index to i. More... | |
void | SetSuccessor (Index jaI, Index joI, JointActionObservationHistoryTree *suc) |
Sets the sucI'th successor of this TreeNode to suc. More... | |
Public Member Functions inherited from TreeNode< JointActionObservationHistory > | |
bool | ExistsSuccessor (LIndex sucI) |
Check whether a particular successor sucI exists. More... | |
JointActionObservationHistory * | GetContainedElement () const |
Returns a pointer to the contained element (Tcontained) More... | |
LIndex | GetIndex () const |
Returns the index of this TreeNode (and thus corresponding to the contained element). More... | |
TreeNode * | GetPredecessor () const |
Get the predecessor TreeNode*. More... | |
TreeNode * | GetSuccessor (LIndex sucI) |
Get the succesor TreeNode* for the sucI'th successor. More... | |
void | Print () const |
Prints the tree starting from this node of the history tree (including the successors). More... | |
void | PrintThisNode () const |
Prints only this node of the history tree (not the successors). More... | |
void | SetIndex (LIndex i) |
Sets the index to i. More... | |
void | SetPredeccessor (TreeNode< JointActionObservationHistory > *pred) |
Sets the predecessor of this node to be pred. More... | |
void | SetSuccessor (LIndex sucI, TreeNode< JointActionObservationHistory > *suc) |
Sets the sucI'th successor of this TreeNode to suc. More... | |
TreeNode () | |
(default) Constructor More... | |
TreeNode (JointActionObservationHistory *const oh) | |
TreeNode (const TreeNode &a) | |
Copy constructor. More... | |
virtual | ~TreeNode () |
Destructor. More... | |
Private Types | |
enum | aoh_t { A_SUC, O_SUC } |
Private Attributes | |
aoh_t | _m_nodeType |
Additional Inherited Members | |
Protected Attributes inherited from TreeNode< JointActionObservationHistory > | |
JointActionObservationHistory * | _m_containedElem |
The contained element. More... | |
LIndex | _m_index |
The index of this TreeNode (and thus of the contained Tcontained - typically an observation history). More... | |
bool | _m_indexValid |
Whether the index is valid. More... | |
TreeNode < JointActionObservationHistory > * | _m_pred |
A Pointer to the predecessor. More... | |
std::map< LIndex, TreeNode < JointActionObservationHistory > * > | _m_successor |
The map that stores the pointers to the successor TreeNodes. More... | |
JointActionObservationHistoryTree is derived from TreeNode, and similar to ObservationHistoryTree:
JointActionObservationHistoryTree is a class that represents a wrapper for the JointActionObservationHistory class. An JointActionObservationHistoryTree actually represents a node in the tree of observation histories. But each node also specifies a (sub-)tree so there is no actual difference between a tree and a node. This implementation assumes that ActionObservationHistories are always contained in exactly 1 JointActionObservationHistoryTree: i.e., deleting an object of JointActionObservationHistoryTree will free the memory of the node and the subtree represented by it as well as the memory of all the contained ActionObservationHistories.
A difference with ObservationHistoryTree is that here a successor is specified by 2 indices. One option would be to combine these into a joint index, but this would add calculation every time we're traversing the tree. Instead this class defines 2 types of nodes: ones that specify the action successor (A_SUC) and ones that specify the observation successor (O_SUC). Only the A_SUC nodes contain actual ActionObservationHistories, O_SUC nodes are 'intermediate nodes' and no operations should be performed on them.
|
private |
(default) Constructor
Referenced by GetSuccessor(), and SetSuccessor().
JointActionObservationHistoryTree::JointActionObservationHistoryTree | ( | JointActionObservationHistory *const | aoh, |
aoh_t | nt = A_SUC |
||
) |
Create a joint observation history tree for joh.
References _m_nodeType.
JointActionObservationHistory * JointActionObservationHistoryTree::GetJointActionObservationHistory | ( | ) | const |
Returns the contained JointActionObservationHistory*.
References _m_nodeType, TreeNode< JointActionObservationHistory >::GetContainedElement(), and O_SUC.
Referenced by PlanningUnitMADPDiscrete::GetJAOHProbs(), PlanningUnitMADPDiscrete::GetJointActionObservationHistoryVectors(), GetSuccessor(), PlanningUnitMADPDiscrete::JointToIndividualActionObservationHistoryIndicesRef(), BayesianGameForDecPOMDPStage::ProbRewardForjoahI(), and GMAA_MAA_ELSI::ProbRewardForjoahI().
|
inline |
Returns the length of the containted JointActionObservationHistory.
References TreeNode< JointActionObservationHistory >::GetContainedElement().
Referenced by GetPredecessor(), MonahanPlanner::GetQ(), and PlanningUnitMADPDiscrete::GetTimeStepForJAOHI().
JointActionObservationHistoryTree * JointActionObservationHistoryTree::GetPredecessor | ( | ) | const |
Returns the predecessor JointActionObservationHistoryTree*.
References _m_nodeType, GetLength(), and O_SUC.
JointActionObservationHistoryTree * JointActionObservationHistoryTree::GetSuccessor | ( | Index | aI, |
Index | oI | ||
) |
Returns the successor JointActionObservationHistoryTree* for joint action jaI and joint observation joI.
Generates a successor if it does not exist yet (in case we did not generate cache the whole tree).
References _m_nodeType, TreeNode< JointActionObservationHistory >::GetIndex(), GetJointActionObservationHistory(), JointActionObservationHistory::GetPlanningUnitMADPDiscrete(), JointActionObservationHistoryTree(), O_SUC, SetIndex(), and SetSuccessor().
Referenced by QPOMDP::ComputeRecursively(), QBG::ComputeRecursively(), BayesianGameForDecPOMDPStage::ProbRewardForjoahI(), and GMAA_MAA_ELSI::ProbRewardForjoahI().
void JointActionObservationHistoryTree::Print | ( | ) | const |
References TreeNode< JointActionObservationHistory >::_m_containedElem, TreeNode< JointActionObservationHistory >::_m_index, TreeNode< JointActionObservationHistory >::_m_indexValid, _m_nodeType, TreeNode< JointActionObservationHistory >::_m_successor, A_SUC, JointActionObservationHistory::Print(), and Print().
Referenced by PlanningUnitMADPDiscrete::InitializeJointActionObservationHistories(), Print(), and PlanningUnitMADPDiscrete::Print().
void JointActionObservationHistoryTree::SetIndex | ( | LIndex | i | ) |
Sets the index to i.
References _m_nodeType, O_SUC, and TreeNode< Tcontained >::SetIndex().
Referenced by GetSuccessor(), and PlanningUnitMADPDiscrete::InitializeJointActionObservationHistories().
void JointActionObservationHistoryTree::SetSuccessor | ( | Index | jaI, |
Index | joI, | ||
JointActionObservationHistoryTree * | suc | ||
) |
Sets the sucI'th successor of this TreeNode to suc.
For example, the successor for observation number sucI.
References _m_nodeType, JointActionObservationHistoryTree(), O_SUC, and TreeNode< Tcontained >::SetSuccessor().
Referenced by GetSuccessor(), and PlanningUnitMADPDiscrete::InitializeJointActionObservationHistories().
|
private |