MultiAgentDecisionProcess
Release 0.2.1
|
ObservationHistory represents an action history of a single agent. More...
#include <ObservationHistory.h>
Public Member Functions | |
virtual ObservationHistory * | Clone () 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 ObservationHistory * | GetPredecessor () 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. | |
![]() | |
PlanningUnitMADPDiscrete * | GetReferred () 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. | |
![]() | |
IndividualHistory (Index agentI) | |
(default) Constructor | |
virtual | ~IndividualHistory () |
Destructor. | |
![]() | |
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 | |
![]() | |
Index | _m_agentI |
The agent this history belongs to. |
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.
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 | ( | ) |
|
inlinevirtual |
Returns a pointer to a copy of this class.
Implements History.
Definition at line 102 of file ObservationHistory.h.
References ObservationHistory().
|
inline |
Check whether this history contains an empty observation.
Definition at line 91 of file ObservationHistory.h.
References _m_containsEmptyOI.
Referenced by ActionObservationHistory::SoftPrint().
|
inline |
Returns the index of the last observation.
Definition at line 97 of file ObservationHistory.h.
References _m_observationI.
Referenced by ActionObservationHistory::SoftPrint().
|
inline |
Return a reference to the Observation history that precedes this.
Definition at line 94 of file ObservationHistory.h.
References _m_pred.
|
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 |
Prints a description of this to a string.
Definition at line 72 of file ObservationHistory.cpp.
References IndividualHistory::_m_agentI, _m_containsEmptyOI, History::_m_length, _m_observationI, _m_pred, PlanningUnitMADPDiscrete::GetObservation(), Referrer< PlanningUnitMADPDiscrete >::GetReferred(), SoftPrint(), and NamedDescribedEntity::SoftPrintBrief().
Referenced by Print(), and SoftPrint().
|
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().
|
private |
The last observation (index).
Definition at line 54 of file ObservationHistory.h.
Referenced by GetLastObservationIndex(), ObservationHistory(), and SoftPrint().
|
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().