MultiAgentDecisionProcess  Release 0.2.1
JointActionObservationHistoryTree Class Reference

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

#include <JointActionObservationHistoryTree.h>

+ Inheritance diagram for JointActionObservationHistoryTree:
+ Collaboration diagram for JointActionObservationHistoryTree:

Public Member Functions

JointActionObservationHistoryGetJointActionObservationHistory () const
 Returns the contained JointActionObservationHistory*.
size_t GetLength () const
 Returns the length of the containted JointActionObservationHistory.
JointActionObservationHistoryTreeGetPredecessor () const
 Returns the predecessor JointActionObservationHistoryTree*.
JointActionObservationHistoryTreeGetSuccessor (Index jaI, Index joI)
 Returns the successor JointActionObservationHistoryTree* for joint action jaI and joint observation joI.
 JointActionObservationHistoryTree (aoh_t nt=A_SUC)
 (default) Constructor
 JointActionObservationHistoryTree (JointActionObservationHistory *const aoh, aoh_t nt=A_SUC)
 Create a joint observation history tree for joh.
void Print () const
 Prints the tree starting from this node of the history tree (including the successors).
void SetIndex (Index i)
 Sets the index to i.
void SetSuccessor (Index jaI, Index joI, JointActionObservationHistoryTree *suc)
 Sets the sucI'th successor of this TreeNode to suc.
- Public Member Functions inherited from TreeNode< JointActionObservationHistory >
bool ExistsSuccessor (Index sucI)
 Check whether a particular successor sucI exists.
JointActionObservationHistoryGetContainedElement () const
 Returns a pointer to the contained element (Tcontained)
Index GetIndex () const
 Returns the index of this TreeNode (and thus corresponding to the contained element).
TreeNodeGetSuccessor (Index sucI)
 Get the succesor TreeNode* for the sucI'th successor.
void PrintThisNode () const
 Prints only this node of the history tree (not the successors).
void SetPredeccessor (TreeNode< JointActionObservationHistory > *pred)
 Sets the predecessor of this node to be pred.
void SetSuccessor (Index sucI, TreeNode< JointActionObservationHistory > *suc)
 Sets the sucI'th successor of this TreeNode to suc.
 TreeNode ()
 (default) Constructor
 TreeNode (JointActionObservationHistory *const oh)
 TreeNode (const TreeNode &a)
 Copy constructor.
virtual ~TreeNode ()
 Destructor.

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.
Index _m_index
 The index of this TreeNode (and thus of the contained Tcontained - typically an observation history).
bool _m_indexValid
 Whether the index is valid.
TreeNode
< JointActionObservationHistory > * 
_m_pred
 A Pointer to the predecessor.
std::map< Index, TreeNode
< JointActionObservationHistory > * > 
_m_successor
 The map that stores the pointers to the successor TreeNodes.

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.

Definition at line 65 of file JointActionObservationHistoryTree.h.

Member Enumeration Documentation

Enumerator:
A_SUC 
O_SUC 

Definition at line 68 of file JointActionObservationHistoryTree.h.

Constructor & Destructor Documentation

JointActionObservationHistoryTree::JointActionObservationHistoryTree ( aoh_t  nt = A_SUC)
inline

(default) Constructor

Definition at line 77 of file JointActionObservationHistoryTree.h.

Referenced by GetSuccessor(), and SetSuccessor().

JointActionObservationHistoryTree::JointActionObservationHistoryTree ( JointActionObservationHistory *const  aoh,
aoh_t  nt = A_SUC 
)

Create a joint observation history tree for joh.

Definition at line 36 of file JointActionObservationHistoryTree.cpp.

References _m_nodeType.

Member Function Documentation

size_t JointActionObservationHistoryTree::GetLength ( ) const
inline
JointActionObservationHistoryTree * JointActionObservationHistoryTree::GetPredecessor ( ) const

Returns the predecessor JointActionObservationHistoryTree*.

Reimplemented from TreeNode< JointActionObservationHistory >.

Definition at line 142 of file JointActionObservationHistoryTree.cpp.

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

Definition at line 100 of file JointActionObservationHistoryTree.cpp.

References _m_nodeType, TreeNode< JointActionObservationHistory >::GetIndex(), GetJointActionObservationHistory(), Referrer< T >::GetReferred(), JointActionObservationHistoryTree(), O_SUC, SetIndex(), and SetSuccessor().

Referenced by QPOMDP::ComputeRecursively(), QBG::ComputeRecursively(), and BayesianGameForDecPOMDPStage::ProbRewardForjoahI().

void JointActionObservationHistoryTree::SetIndex ( Index  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.

Definition at line 75 of file JointActionObservationHistoryTree.cpp.

References _m_nodeType, JointActionObservationHistoryTree(), and O_SUC.

Referenced by GetSuccessor(), and PlanningUnitMADPDiscrete::InitializeJointActionObservationHistories().

Member Data Documentation

aoh_t JointActionObservationHistoryTree::_m_nodeType
private

The documentation for this class was generated from the following files: