MultiAgentDecisionProcess
|
ActionObservationHistoryTree is a wrapper for ActionObservationHistory. More...
#include <ActionObservationHistoryTree.h>
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... | |
ActionObservationHistory * | GetActionObservationHistory () const |
Get the history stored in this node. More... | |
ActionObservationHistoryTree * | GetSuccessor (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... | |
ActionObservationHistory * | 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< 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... | |
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.
|
private |
(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.
ActionObservationHistory * ActionObservationHistoryTree::GetActionObservationHistory | ( | ) | const |
Get the history stored in this node.
References _m_nodeType, TreeNode< ActionObservationHistory >::GetContainedElement(), and O_SUC.
Referenced by PlanningUnitMADPDiscrete::CreateActionObservationHistoryTree().
ActionObservationHistoryTree * ActionObservationHistoryTree::GetSuccessor | ( | Index | aI, |
Index | oI | ||
) |
Get the successor node.
References _m_nodeType, and O_SUC.
void ActionObservationHistoryTree::Print | ( | ) | const |
References TreeNode< ActionObservationHistory >::_m_containedElem, TreeNode< ActionObservationHistory >::_m_index, TreeNode< ActionObservationHistory >::_m_indexValid, _m_nodeType, TreeNode< ActionObservationHistory >::_m_successor, A_SUC, ActionObservationHistory::Print(), and Print().
Referenced by PlanningUnitMADPDiscrete::CreateActionObservationHistoryTree(), and Print().
void ActionObservationHistoryTree::SetIndex | ( | Index | i | ) |
Sets the index to i.
References _m_nodeType, O_SUC, and TreeNode< Tcontained >::SetIndex().
Referenced by PlanningUnitMADPDiscrete::CreateActionObservationHistoryTree().
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().
|
private |
Referenced by ActionObservationHistoryTree(), GetActionObservationHistory(), GetSuccessor(), Print(), SetIndex(), and SetSuccessor().