MultiAgentDecisionProcess
JointActionObservationHistoryTree Class Reference

JointActionObservationHistoryTree is derived from TreeNode, and similar to ObservationHistoryTree: More...

#include <JointActionObservationHistoryTree.h>

Inheritance diagram for JointActionObservationHistoryTree:
[legend]

Public Member Functions

JointActionObservationHistoryGetJointActionObservationHistory () const
 Returns the contained JointActionObservationHistory*. More...
 
size_t GetLength () const
 Returns the length of the containted JointActionObservationHistory. More...
 
JointActionObservationHistoryTreeGetPredecessor () const
 Returns the predecessor JointActionObservationHistoryTree*. More...
 
JointActionObservationHistoryTreeGetSuccessor (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...
 
JointActionObservationHistoryGetContainedElement () 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...
 
TreeNodeGetPredecessor () const
 Get the predecessor TreeNode*. More...
 
TreeNodeGetSuccessor (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...
 

Detailed Description

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.

Member Enumeration Documentation

Enumerator
A_SUC 
O_SUC 

Constructor & Destructor Documentation

JointActionObservationHistoryTree::JointActionObservationHistoryTree ( aoh_t  nt = A_SUC)
inline

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

Member Function Documentation

size_t JointActionObservationHistoryTree::GetLength ( ) const
inline
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::SetIndex ( LIndex  i)
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().

Member Data Documentation