MultiAgentDecisionProcess  Release 0.2.1
JointActionHistory Class Reference

JointActionHistory represents a joint action history. More...

#include <JointActionHistory.h>

+ Inheritance diagram for JointActionHistory:
+ Collaboration diagram for JointActionHistory:

Public Member Functions

virtual JointActionHistoryClone () const
 Returns a pointer to a copy of this class.
const std::vector< Index > & GetIndividualActionHistoryIndices () const
 Returns the indices of the indiv. action histories.
 JointActionHistory (PlanningUnitMADPDiscrete &pu)
 Constructor - creates a new initial (=empty) JointActionHistory.
 JointActionHistory (PlanningUnitMADPDiscrete &pu, Index jObsI)
 Creates a initial action history specifying obsI as the action at time step t=0 (o^t=0)
 JointActionHistory (Index jObsI, JointActionHistory *pred)
 Creates a action history specifying jObsI for the last joint action and pred as the preceeding JointActionHistory.
 JointActionHistory (const JointActionHistory &a)
 Copy constructor.
void Print () const
 Prints the joint observation history.
std::string SoftPrint () const
 SoftPrints the joint observation history.
 ~JointActionHistory ()
 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 JointHistory
 JointHistory ()
 (default) Constructor
virtual ~JointHistory ()
 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

std::vector< Index > _m_individualActionHistories
 A vector of ints which are the indices of individual ActionHistories this gives an alternate description of the current JointAction History.
bool _m_isEmpty
 True if the last joint action (index) is empty (i.e., there is no last joint action.) This is true for a action history at time step 0.
Index _m_jointActionI
 The last joint action (index).
JointActionHistory_m_pred
 The predecessor joint belief.

Additional Inherited Members

- Protected Attributes inherited from History
size_t _m_length
 How long (how many time-steps) is this history?

Detailed Description

JointActionHistory represents a joint action history.

This consists of a joint action history index, the last joint action (index) a pointer to the predecessor JOH. and a vector of indexes to the individual action histories.

Definition at line 49 of file JointActionHistory.h.

Constructor & Destructor Documentation

JointActionHistory::JointActionHistory ( PlanningUnitMADPDiscrete pu)

Constructor - creates a new initial (=empty) JointActionHistory.

This method relies on the fact that the empty individual action histories are indexed 0.

Definition at line 38 of file JointActionHistory.cpp.

References _m_individualActionHistories, _m_isEmpty, _m_jointActionI, _m_pred, PlanningUnitMADPDiscrete::GetNrAgents(), and History::SetLength().

Referenced by Clone().

JointActionHistory::JointActionHistory ( PlanningUnitMADPDiscrete pu,
Index  jObsI 
)

Creates a initial action history specifying obsI as the action at time step t=0 (o^t=0)

Definition at line 48 of file JointActionHistory.cpp.

JointActionHistory::JointActionHistory ( Index  jObsI,
JointActionHistory pred 
)

Creates a action history specifying jObsI for the last joint action and pred as the preceeding JointActionHistory.

Definition at line 54 of file JointActionHistory.cpp.

References _m_individualActionHistories, _m_isEmpty, _m_jointActionI, _m_pred, History::GetLength(), Referrer< PlanningUnitMADPDiscrete >::GetReferred(), and History::SetLength().

JointActionHistory::JointActionHistory ( const JointActionHistory a)

Copy constructor.

Definition at line 89 of file JointActionHistory.cpp.

References DEBUG_JOH, and Print().

JointActionHistory::~JointActionHistory ( )

Destructor.

Definition at line 95 of file JointActionHistory.cpp.

References DEBUG_JOH, and Print().

Member Function Documentation

virtual JointActionHistory* JointActionHistory::Clone ( ) const
inlinevirtual

Returns a pointer to a copy of this class.

Implements History.

Definition at line 99 of file JointActionHistory.h.

References JointActionHistory().

const vector< Index > & JointActionHistory::GetIndividualActionHistoryIndices ( ) const

Returns the indices of the indiv. action histories.

Definition at line 103 of file JointActionHistory.cpp.

References _m_individualActionHistories.

void JointActionHistory::Print ( ) const
inlinevirtual

Prints the joint observation history.

Implements History.

Definition at line 105 of file JointActionHistory.h.

References SoftPrint().

Referenced by PlanningUnitMADPDiscrete::InitializeJointActionHistories(), JointActionHistory(), and ~JointActionHistory().

string JointActionHistory::SoftPrint ( ) const

Member Data Documentation

std::vector<Index> JointActionHistory::_m_individualActionHistories
private

A vector of ints which are the indices of individual ActionHistories this gives an alternate description of the current JointAction History.

Definition at line 68 of file JointActionHistory.h.

Referenced by GetIndividualActionHistoryIndices(), and JointActionHistory().

bool JointActionHistory::_m_isEmpty
private

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

Definition at line 60 of file JointActionHistory.h.

Referenced by JointActionHistory(), and SoftPrint().

Index JointActionHistory::_m_jointActionI
private

The last joint action (index).

Definition at line 55 of file JointActionHistory.h.

Referenced by JointActionHistory(), and SoftPrint().

JointActionHistory* JointActionHistory::_m_pred
private

The predecessor joint belief.

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

Definition at line 64 of file JointActionHistory.h.

Referenced by JointActionHistory(), and SoftPrint().


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