MultiAgentDecisionProcess
ActionObservationHistoryTree Class Reference

ActionObservationHistoryTree is a wrapper for ActionObservationHistory. More...

#include <ActionObservationHistoryTree.h>

Inheritance diagram for ActionObservationHistoryTree:
[legend]

Public Member Functions

 ActionObservationHistoryTree (aoh_t nt=A_SUC)
 (default) Constructor More...
 
 ActionObservationHistoryTree (ActionObservationHistory *const aoh, aoh_t nt=A_SUC)
 Create a joint observation history tree for joh. More...
 
 ActionObservationHistoryTree (const ActionObservationHistoryTree &a)
 Copy constructor. More...
 
ActionObservationHistoryGetActionObservationHistory () const
 Get the history stored in this node. More...
 
ActionObservationHistoryTreeGetSuccessor (Index aI, Index oI)
 Get the successor node. More...
 
void Print () const
 
void SetIndex (Index i)
 Sets the index to i. More...
 
void SetSuccessor (Index aI, Index oI, ActionObservationHistoryTree *suc)
 Sets the sucI'th successor of this TreeNode to suc. More...
 
- Public Member Functions inherited from TreeNode< ActionObservationHistory >
bool ExistsSuccessor (LIndex sucI)
 Check whether a particular successor sucI exists. More...
 
ActionObservationHistoryGetContainedElement () 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< ActionObservationHistory > *pred)
 Sets the predecessor of this node to be pred. More...
 
void SetSuccessor (LIndex sucI, TreeNode< ActionObservationHistory > *suc)
 Sets the sucI'th successor of this TreeNode to suc. More...
 
 TreeNode ()
 (default) Constructor More...
 
 TreeNode (ActionObservationHistory *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< ActionObservationHistory >
ActionObservationHistory_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
< ActionObservationHistory > * 
_m_pred
 A Pointer to the predecessor. More...
 
std::map< LIndex, TreeNode
< ActionObservationHistory > * > 
_m_successor
 The map that stores the pointers to the successor TreeNodes. More...
 

Detailed Description

ActionObservationHistoryTree is a wrapper for ActionObservationHistory.

A class derived from TreeNode, and similar to ObservationHistoryTree:

ActionObservationHistoryTree is a class that represents a wrapper for the ActionObservationHistory class. An ActionObservationHistoryTree 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 ActionObservationHistoryTree: i.e., deleting an object of ActionObservationHistoryTree 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

ActionObservationHistoryTree::ActionObservationHistoryTree ( aoh_t  nt = A_SUC)
inline

(default) Constructor

Referenced by SetSuccessor().

ActionObservationHistoryTree::ActionObservationHistoryTree ( ActionObservationHistory *const  aoh,
aoh_t  nt = A_SUC 
)

Create a joint observation history tree for joh.

References _m_nodeType.

ActionObservationHistoryTree::ActionObservationHistoryTree ( const ActionObservationHistoryTree a)

Copy constructor.

Member Function Documentation

ActionObservationHistory * ActionObservationHistoryTree::GetActionObservationHistory ( ) const
ActionObservationHistoryTree * ActionObservationHistoryTree::GetSuccessor ( Index  aI,
Index  oI 
)

Get the successor node.

References _m_nodeType, and O_SUC.

void ActionObservationHistoryTree::SetIndex ( Index  i)
void ActionObservationHistoryTree::SetSuccessor ( Index  aI,
Index  oI,
ActionObservationHistoryTree suc 
)

Sets the sucI'th successor of this TreeNode to suc.

(e.g. the successor for observation number sucI).

References _m_nodeType, ActionObservationHistoryTree(), O_SUC, and TreeNode< Tcontained >::SetSuccessor().

Referenced by PlanningUnitMADPDiscrete::CreateActionObservationHistoryTree().

Member Data Documentation

aoh_t ActionObservationHistoryTree::_m_nodeType
private