MultiAgentDecisionProcess
Release 0.2.1
|
ActionHistory represents an action history of a single agent. More...
#include <ActionHistory.h>
Public Member Functions | |
ActionHistory (PlanningUnitMADPDiscrete &pu, Index agentI) | |
(default) Constructor - creates a new initial (=empty) ActionHistory for agent agentI | |
ActionHistory (Index aI, ActionHistory *pred) | |
Creates a action history specifying aI for the last action and pred as the preceeding ActionHistory. | |
virtual ActionHistory * | Clone () const |
Returns a pointer to a copy of this class. | |
Index | GetLastActionIndex () const |
Returns the index of the last action. | |
bool | IsEmpty () const |
Check whether this history is empty. | |
void | Print () const |
Print this to cout. | |
std::string | SoftPrint () const |
Prints a description of this to a string. | |
~ActionHistory () | |
Destructor. | |
![]() | |
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 | |
Index | _m_actionI |
The last action (index). | |
bool | _m_isEmpty |
True if the last action (index) is empty (i.e., there is no last action.) This is true for a action history at time step 0. | |
ActionHistory * | _m_pred |
The predecessor joint belief. |
Additional Inherited Members | |
![]() | |
Index | _m_agentI |
The agent this history belongs to. |
ActionHistory represents an action history of a single agent.
It does so by storing an index and a pointer to a preceeding action history.
Definition at line 46 of file ActionHistory.h.
ActionHistory::ActionHistory | ( | PlanningUnitMADPDiscrete & | pu, |
Index | agentI | ||
) |
(default) Constructor - creates a new initial (=empty) ActionHistory for agent agentI
Definition at line 38 of file ActionHistory.cpp.
References _m_actionI, _m_isEmpty, _m_pred, and History::SetLength().
Referenced by Clone().
ActionHistory::ActionHistory | ( | Index | aI, |
ActionHistory * | pred | ||
) |
Creates a action history specifying aI for the last action and pred as the preceeding ActionHistory.
Definition at line 49 of file ActionHistory.cpp.
References _m_actionI, _m_isEmpty, _m_pred, History::GetLength(), and History::SetLength().
ActionHistory::~ActionHistory | ( | ) |
|
inlinevirtual |
Returns a pointer to a copy of this class.
Implements History.
Definition at line 89 of file ActionHistory.h.
References ActionHistory().
|
inline |
Returns the index of the last action.
Definition at line 85 of file ActionHistory.h.
References _m_actionI.
Referenced by ActionObservationHistory::SoftPrint().
|
inline |
Check whether this history is empty.
Definition at line 82 of file ActionHistory.h.
References _m_isEmpty.
Referenced by ActionObservationHistory::SoftPrint().
|
inlinevirtual |
Print this to cout.
Implements History.
Definition at line 95 of file ActionHistory.h.
References SoftPrint().
Referenced by ~ActionHistory().
string ActionHistory::SoftPrint | ( | ) | const |
Prints a description of this to a string.
Definition at line 66 of file ActionHistory.cpp.
References _m_actionI, IndividualHistory::_m_agentI, _m_isEmpty, History::_m_length, _m_pred, PlanningUnitMADPDiscrete::GetAction(), Referrer< PlanningUnitMADPDiscrete >::GetReferred(), and SoftPrint().
Referenced by Print(), and SoftPrint().
|
private |
The last action (index).
Definition at line 52 of file ActionHistory.h.
Referenced by ActionHistory(), GetLastActionIndex(), and SoftPrint().
|
private |
True if the last action (index) is empty (i.e., there is no last action.) This is true for a action history at time step 0.
Definition at line 56 of file ActionHistory.h.
Referenced by ActionHistory(), IsEmpty(), and SoftPrint().
|
private |
The predecessor joint belief.
Together with the last joint action(_m_actionI) this gives a full description of this joint action history.
Definition at line 60 of file ActionHistory.h.
Referenced by ActionHistory(), and SoftPrint().