MultiAgentDecisionProcess
JointActionHistory Class Reference

JointActionHistory represents a joint action history. More...

#include <JointActionHistory.h>

Inheritance diagram for JointActionHistory:
[legend]

Public Member Functions

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

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. More...
 
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. More...
 
Index _m_jointActionI
 The last joint action (index). More...
 
PlanningUnitMADPDiscrete_m_planningUnitMADPDiscrete
 
JointActionHistory_m_pred
 The predecessor joint belief. More...
 

Additional Inherited Members

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

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.

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.

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)

JointActionHistory::JointActionHistory ( Index  jObsI,
JointActionHistory pred 
)

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

References _m_individualActionHistories, _m_isEmpty, _m_jointActionI, _m_planningUnitMADPDiscrete, _m_pred, History::GetLength(), and History::SetLength().

JointActionHistory::JointActionHistory ( const JointActionHistory a)

Copy constructor.

References DEBUG_JOH, and Print().

JointActionHistory::~JointActionHistory ( )

Destructor.

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.

References JointActionHistory().

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

Returns the indices of the indiv. action histories.

References _m_individualActionHistories.

void JointActionHistory::Print ( ) const
inlinevirtual

Prints the joint observation history.

Implements History.

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.

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.

Referenced by JointActionHistory(), and SoftPrint().

Index JointActionHistory::_m_jointActionI
private

The last joint action (index).

Referenced by JointActionHistory(), and SoftPrint().

PlanningUnitMADPDiscrete* JointActionHistory::_m_planningUnitMADPDiscrete
private

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.

Referenced by JointActionHistory(), and SoftPrint().