MultiAgentDecisionProcess  Release 0.2.1
ObservationHistory Class Reference

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

#include <ObservationHistory.h>

+ Inheritance diagram for ObservationHistory:
+ Collaboration diagram for ObservationHistory:

Public Member Functions

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

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.
Index _m_observationI
 The last observation (index).
ObservationHistory_m_pred
 The predecessor observation hist.

Additional Inherited Members

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

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.

Definition at line 48 of file ObservationHistory.h.

Constructor & Destructor Documentation

ObservationHistory::ObservationHistory ( PlanningUnitMADPDiscrete pu,
Index  agentI 
)

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

Definition at line 38 of file ObservationHistory.cpp.

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)

Definition at line 49 of file ObservationHistory.cpp.

ObservationHistory::ObservationHistory ( Index  obsI,
ObservationHistory pred 
)

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

Definition at line 55 of file ObservationHistory.cpp.

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

ObservationHistory::~ObservationHistory ( )

Copy constructor.

Destructor.

Definition at line 66 of file ObservationHistory.cpp.

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.

Definition at line 102 of file ObservationHistory.h.

References ObservationHistory().

bool ObservationHistory::ContainsEmptyOI ( ) const
inline

Check whether this history contains an empty observation.

Definition at line 91 of file ObservationHistory.h.

References _m_containsEmptyOI.

Referenced by ActionObservationHistory::SoftPrint().

Index ObservationHistory::GetLastObservationIndex ( ) const
inline

Returns the index of the last observation.

Definition at line 97 of file ObservationHistory.h.

References _m_observationI.

Referenced by ActionObservationHistory::SoftPrint().

const ObservationHistory* ObservationHistory::GetPredecessor ( ) const
inline

Return a reference to the Observation history that precedes this.

Definition at line 94 of file ObservationHistory.h.

References _m_pred.

void ObservationHistory::Print ( ) const
inlinevirtual

Print this to cout.

Implements History.

Definition at line 108 of file ObservationHistory.h.

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)

Definition at line 61 of file ObservationHistory.h.

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

Index ObservationHistory::_m_observationI
private

The last observation (index).

Definition at line 54 of file ObservationHistory.h.

Referenced by GetLastObservationIndex(), ObservationHistory(), and 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.

Definition at line 65 of file ObservationHistory.h.

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


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