MultiAgentDecisionProcess
ActionHistory Class Reference

ActionHistory represents an action history of a single agent. More...

#include <ActionHistory.h>

Inheritance diagram for ActionHistory:
[legend]

Public Member Functions

 ActionHistory (PlanningUnitMADPDiscrete &pu, Index agentI)
 (default) Constructor - creates a new initial (=empty) ActionHistory for agent agentI More...
 
 ActionHistory (Index aI, ActionHistory *pred)
 Creates a action history specifying aI for the last action and pred as the preceeding ActionHistory. More...
 
virtual ActionHistoryClone () const
 Returns a pointer to a copy of this class. More...
 
Index GetLastActionIndex () const
 Returns the index of the last action. More...
 
bool IsEmpty () const
 Check whether this history is empty. More...
 
void Print () const
 Print this to cout. More...
 
std::string SoftPrint () const
 Prints a description of this to a string. More...
 
 ~ActionHistory ()
 Destructor. More...
 
- Public Member Functions inherited from IndividualHistory
 IndividualHistory (Index agentI)
 (default) Constructor More...
 
virtual ~IndividualHistory ()
 Destructor. More...
 
- Public Member Functions inherited from History
size_t GetLength () const
 Returns the length of the history, i.e., the number of time steps. More...
 
 History ()
 (default) Constructor More...
 
void SetLength (size_t length)
 Set the length of the history, i.e., the number of time steps. More...
 
virtual ~History ()
 Destructor. More...
 

Private Attributes

Index _m_actionI
 The last action (index). More...
 
bool _m_isEmpty
 True if the last action (index) is empty (i.e., there is no last action.) This is true for a action history at time step 0. More...
 
PlanningUnitMADPDiscrete_m_planningUnitMADPDiscrete
 
ActionHistory_m_pred
 The predecessor joint belief. More...
 

Additional Inherited Members

- Protected Attributes inherited from IndividualHistory
Index _m_agentI
 The agent this history belongs to. More...
 
- Protected Attributes inherited from History
size_t _m_length
 How long (how many time-steps) is this history? More...
 

Detailed Description

ActionHistory represents an action history of a single agent.

It does so by storing an index and a pointer to a preceeding action history.

Constructor & Destructor Documentation

ActionHistory::ActionHistory ( PlanningUnitMADPDiscrete pu,
Index  agentI 
)

(default) Constructor - creates a new initial (=empty) ActionHistory for agent agentI

References _m_actionI, _m_isEmpty, _m_pred, and History::SetLength().

Referenced by Clone().

ActionHistory::ActionHistory ( Index  aI,
ActionHistory pred 
)

Creates a action history specifying aI for the last action and pred as the preceeding ActionHistory.

References _m_actionI, _m_isEmpty, _m_pred, History::GetLength(), and History::SetLength().

ActionHistory::~ActionHistory ( )

Destructor.

References DEBUG_AH, and Print().

Member Function Documentation

virtual ActionHistory* ActionHistory::Clone ( ) const
inlinevirtual

Returns a pointer to a copy of this class.

Implements History.

References ActionHistory().

Index ActionHistory::GetLastActionIndex ( ) const
inline

Returns the index of the last action.

References _m_actionI.

Referenced by ActionObservationHistory::SoftPrint().

bool ActionHistory::IsEmpty ( ) const
inline

Check whether this history is empty.

References _m_isEmpty.

Referenced by ActionObservationHistory::SoftPrint().

void ActionHistory::Print ( ) const
inlinevirtual

Print this to cout.

Implements History.

References SoftPrint().

Referenced by ~ActionHistory().

string ActionHistory::SoftPrint ( ) const

Member Data Documentation

Index ActionHistory::_m_actionI
private

The last action (index).

Referenced by ActionHistory(), GetLastActionIndex(), and SoftPrint().

bool ActionHistory::_m_isEmpty
private

True if the last action (index) is empty (i.e., there is no last action.) This is true for a action history at time step 0.

Referenced by ActionHistory(), IsEmpty(), and SoftPrint().

PlanningUnitMADPDiscrete* ActionHistory::_m_planningUnitMADPDiscrete
private

Referenced by SoftPrint().

ActionHistory* ActionHistory::_m_pred
private

The predecessor joint belief.

Together with the last joint action(_m_actionI) this gives a full description of this joint action history.

Referenced by ActionHistory(), and SoftPrint().