MultiAgentDecisionProcess
Release 0.2.1
|
TreeNode represents a node in a tree of histories, for instance observation histories. More...
#include <TreeNode.h>
Public Member Functions | |
bool | ExistsSuccessor (Index sucI) |
Check whether a particular successor sucI exists. | |
Tcontained * | GetContainedElement () 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). | |
TreeNode * | GetPredecessor () const |
Get the predecessor TreeNode*. | |
TreeNode * | GetSuccessor (Index sucI) |
Get the succesor TreeNode* for the sucI'th successor. | |
void | Print () const |
Prints the tree starting from this node of the history tree (including the successors). | |
void | PrintThisNode () const |
Prints only this node of the history tree (not the successors). | |
void | SetIndex (Index i) |
Sets the index to i. | |
void | SetPredeccessor (TreeNode< Tcontained > *pred) |
Sets the predecessor of this node to be pred. | |
void | SetSuccessor (Index sucI, TreeNode< Tcontained > *suc) |
Sets the sucI'th successor of this TreeNode to suc. | |
TreeNode () | |
(default) Constructor | |
TreeNode (Tcontained *const oh) | |
TreeNode (const TreeNode &a) | |
Copy constructor. | |
virtual | ~TreeNode () |
Destructor. |
Protected Attributes | |
Tcontained * | _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< Tcontained > * | _m_pred |
A Pointer to the predecessor. | |
std::map< Index, TreeNode < Tcontained > * > | _m_successor |
The map that stores the pointers to the successor TreeNodes. |
TreeNode represents a node in a tree of histories, for instance observation histories.
TreeNode is a class that represents a wrapper for the Tcontained class. Each node also specifies a (sub-)tree so there is no actual difference between a tree and a node. This implementation assumes that ObservationHistories are always contained in exactly 1 TreeNode: i.e., deleting an object of TreeNode will free the memory of the node and the subtree represented by it as well as the memory of all the contained ObservationHistories.
Definition at line 53 of file TreeNode.h.
(default) Constructor
Definition at line 75 of file TreeNode.h.
Definition at line 83 of file TreeNode.h.
|
inline |
Copy constructor.
Definition at line 91 of file TreeNode.h.
Destructor.
Definition at line 107 of file TreeNode.h.
bool TreeNode< Tcontained >::ExistsSuccessor | ( | Index | sucI | ) |
Check whether a particular successor sucI exists.
Definition at line 214 of file TreeNode.h.
|
inline |
Returns a pointer to the contained element (Tcontained)
Definition at line 160 of file TreeNode.h.
Referenced by PlanningUnitMADPDiscrete::CreateObservationHistoryTree(), PlanningUnitMADPDiscrete::InitializeJointObservationHistories(), and ActionObservationHistory::SoftPrint().
|
inline |
Returns the index of this TreeNode (and thus corresponding to the contained element).
Definition at line 152 of file TreeNode.h.
Referenced by ActionObservationHistory::ActionObservationHistory(), QPOMDP::ComputeRecursively(), QBG::ComputeRecursively(), QBG::ComputeRecursivelyNoCache(), BayesianGameForDecPOMDPStage::ProbRewardForjoahI(), and PlanningUnitMADPDiscrete::RegisterJointActionObservationHistoryTree().
Get the predecessor TreeNode*.
Reimplemented in JointActionObservationHistoryTree, JointObservationHistoryTree, and ObservationHistoryTree.
Definition at line 147 of file TreeNode.h.
TreeNode< Tcontained > * TreeNode< Tcontained >::GetSuccessor | ( | Index | sucI | ) |
Get the succesor TreeNode* for the sucI'th successor.
Reimplemented in JointObservationHistoryTree, and ObservationHistoryTree.
Definition at line 205 of file TreeNode.h.
void TreeNode< Tcontained >::Print | ( | ) | const |
Prints the tree starting from this node of the history tree (including the successors).
Reimplemented in JointActionObservationHistoryTree, and ActionObservationHistoryTree.
Definition at line 234 of file TreeNode.h.
Referenced by PlanningUnitMADPDiscrete::InitializeJointObservationHistories().
void TreeNode< Tcontained >::PrintThisNode | ( | ) | const |
Prints only this node of the history tree (not the successors).
Definition at line 224 of file TreeNode.h.
Referenced by TreeNode< ObservationHistory >::TreeNode(), and TreeNode< ObservationHistory >::~TreeNode().
|
inline |
Sets the index to i.
Reimplemented in ActionObservationHistoryTree, and JointActionObservationHistoryTree.
Definition at line 129 of file TreeNode.h.
Referenced by PlanningUnitMADPDiscrete::CreateObservationHistoryTree(), and PlanningUnitMADPDiscrete::InitializeJointObservationHistories().
|
inline |
Sets the predecessor of this node to be pred.
This function is typically called by SetSuccessor (not manually).
Definition at line 139 of file TreeNode.h.
Referenced by TreeNode< Tcontained >::SetSuccessor().
void TreeNode< Tcontained >::SetSuccessor | ( | Index | sucI, |
TreeNode< Tcontained > * | suc | ||
) |
Sets the sucI'th successor of this TreeNode to suc.
For example, the successor for observation number sucI. Also sets the predecessor of suc to this.
Definition at line 175 of file TreeNode.h.
References TreeNode< Tcontained >::SetPredeccessor().
Referenced by PlanningUnitMADPDiscrete::CreateObservationHistoryTree(), and PlanningUnitMADPDiscrete::InitializeJointObservationHistories().
|
protected |
The contained element.
Definition at line 68 of file TreeNode.h.
Referenced by TreeNode< ObservationHistory >::GetContainedElement(), TreeNode< ObservationHistory >::TreeNode(), and TreeNode< ObservationHistory >::~TreeNode().
|
protected |
The index of this TreeNode (and thus of the contained Tcontained - typically an observation history).
Definition at line 64 of file TreeNode.h.
Referenced by TreeNode< ObservationHistory >::GetIndex(), TreeNode< ObservationHistory >::SetIndex(), and TreeNode< ObservationHistory >::TreeNode().
|
protected |
Whether the index is valid.
Definition at line 66 of file TreeNode.h.
Referenced by TreeNode< ObservationHistory >::GetIndex(), TreeNode< ObservationHistory >::SetIndex(), and TreeNode< ObservationHistory >::TreeNode().
A Pointer to the predecessor.
Definition at line 61 of file TreeNode.h.
Referenced by TreeNode< ObservationHistory >::GetPredecessor(), TreeNode< ObservationHistory >::SetPredeccessor(), and TreeNode< ObservationHistory >::TreeNode().
|
protected |
The map that stores the pointers to the successor TreeNodes.
Definition at line 59 of file TreeNode.h.
Referenced by TreeNode< ObservationHistory >::TreeNode(), and TreeNode< ObservationHistory >::~TreeNode().