MultiAgentDecisionProcess
ObservationHistory Class Reference

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

#include <ObservationHistory.h>

Inheritance diagram for ObservationHistory:
[legend]

Public Member Functions

virtual ObservationHistoryClone () const
 Returns a pointer to a copy of this class. More...
 
bool ContainsEmptyOI () const
 Check whether this history contains an empty observation. More...
 
Index GetLastObservationIndex () const
 Returns the index of the last observation. More...
 
const ObservationHistoryGetPredecessor () const
 Return a reference to the Observation history that precedes this. More...
 
 ObservationHistory (PlanningUnitMADPDiscrete &pu, Index agentI)
 (default) Constructor - creates a new initial (=empty) ObservationHistory for agent agentI More...
 
 ObservationHistory (PlanningUnitMADPDiscrete &pu, Index agentI, Index obsI)
 Creates a initial observation history specifying obsI as the observation at time step t=0 (o^t=0) More...
 
 ObservationHistory (Index obsI, ObservationHistory *pred)
 Creates a observation history specifying obsI for the last observation and pred as the preceeding ObservationHistory. More...
 
void Print () const
 Print this to cout. More...
 
std::string SoftPrint () const
 Prints a description of this to a string. More...
 
 ~ObservationHistory ()
 Copy constructor. 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

bool _m_containsEmptyOI
 True if the last observation (index) is empty (i.e., there is no last observation.) This is particularly true for a observation history at time step t=0 in a MADP that does not issue an initial observation. More...
 
Index _m_observationI
 The last observation (index). More...
 
PlanningUnitMADPDiscrete_m_PlanningUnitMADPDiscrete
 ref to the pu More...
 
ObservationHistory_m_pred
 The predecessor observation hist. 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

ObservationHistory represents an action history of a single agent.

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

Constructor & Destructor Documentation

ObservationHistory::ObservationHistory ( PlanningUnitMADPDiscrete pu,
Index  agentI 
)

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

References _m_containsEmptyOI, _m_observationI, _m_pred, and History::SetLength().

Referenced by Clone().

ObservationHistory::ObservationHistory ( PlanningUnitMADPDiscrete pu,
Index  agentI,
Index  obsI 
)

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

ObservationHistory::ObservationHistory ( Index  obsI,
ObservationHistory pred 
)

Creates a observation history specifying obsI for the last observation and pred as the preceeding ObservationHistory.

References _m_containsEmptyOI, _m_observationI, _m_pred, History::GetLength(), and History::SetLength().

ObservationHistory::~ObservationHistory ( )

Copy constructor.

Destructor.

References DEBUG_OH, and Print().

Member Function Documentation

virtual ObservationHistory* ObservationHistory::Clone ( ) const
inlinevirtual

Returns a pointer to a copy of this class.

Implements History.

References ObservationHistory().

bool ObservationHistory::ContainsEmptyOI ( ) const
inline

Check whether this history contains an empty observation.

References _m_containsEmptyOI.

Referenced by ActionObservationHistory::SoftPrint().

Index ObservationHistory::GetLastObservationIndex ( ) const
inline

Returns the index of the last observation.

References _m_observationI.

Referenced by ActionObservationHistory::SoftPrint().

const ObservationHistory* ObservationHistory::GetPredecessor ( ) const
inline

Return a reference to the Observation history that precedes this.

References _m_pred.

void ObservationHistory::Print ( ) const
inlinevirtual

Print this to cout.

Implements History.

References SoftPrint().

Referenced by ~ObservationHistory().

string ObservationHistory::SoftPrint ( void  ) const

Member Data Documentation

bool ObservationHistory::_m_containsEmptyOI
private

True if the last observation (index) is empty (i.e., there is no last observation.) This is particularly true for a observation history at time step t=0 in a MADP that does not issue an initial observation.

(this behavior is defined in MADPComponentDiscreteObservations)

Referenced by ContainsEmptyOI(), ObservationHistory(), and SoftPrint().

Index ObservationHistory::_m_observationI
private

The last observation (index).

Referenced by GetLastObservationIndex(), ObservationHistory(), and SoftPrint().

PlanningUnitMADPDiscrete* ObservationHistory::_m_PlanningUnitMADPDiscrete
private

ref to the pu

Referenced by SoftPrint().

ObservationHistory* ObservationHistory::_m_pred
private

The predecessor observation hist.

Together with the last joint observation(_m_observationI) this gives a full description of this observation history.

Referenced by GetPredecessor(), ObservationHistory(), and SoftPrint().