MultiAgentDecisionProcess  Release 0.2.1
ActionHistory Class Reference

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

#include <ActionHistory.h>

+ Inheritance diagram for ActionHistory:
+ Collaboration diagram for ActionHistory:

Public Member Functions

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

Private Attributes

Index _m_actionI
 The last action (index).
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.
ActionHistory_m_pred
 The predecessor joint belief.

Additional Inherited Members

- Protected Attributes inherited from IndividualHistory
Index _m_agentI
 The agent this history belongs to.

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.

Definition at line 46 of file ActionHistory.h.

Constructor & Destructor Documentation

ActionHistory::ActionHistory ( PlanningUnitMADPDiscrete pu,
Index  agentI 
)

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

Definition at line 38 of file ActionHistory.cpp.

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.

Definition at line 49 of file ActionHistory.cpp.

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

ActionHistory::~ActionHistory ( )

Destructor.

Definition at line 60 of file ActionHistory.cpp.

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.

Definition at line 89 of file ActionHistory.h.

References ActionHistory().

Index ActionHistory::GetLastActionIndex ( ) const
inline

Returns the index of the last action.

Definition at line 85 of file ActionHistory.h.

References _m_actionI.

Referenced by ActionObservationHistory::SoftPrint().

bool ActionHistory::IsEmpty ( ) const
inline

Check whether this history is empty.

Definition at line 82 of file ActionHistory.h.

References _m_isEmpty.

Referenced by ActionObservationHistory::SoftPrint().

void ActionHistory::Print ( ) const
inlinevirtual

Print this to cout.

Implements History.

Definition at line 95 of file ActionHistory.h.

References SoftPrint().

Referenced by ~ActionHistory().

string ActionHistory::SoftPrint ( ) const

Member Data Documentation

Index ActionHistory::_m_actionI
private

The last action (index).

Definition at line 52 of file ActionHistory.h.

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.

Definition at line 56 of file ActionHistory.h.

Referenced by ActionHistory(), IsEmpty(), and 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.

Definition at line 60 of file ActionHistory.h.

Referenced by ActionHistory(), and SoftPrint().


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