MultiAgentDecisionProcess
Release 0.2.1
|
JointActionHistory represents a joint action history. More...
#include <JointActionHistory.h>
Public Member Functions | |
virtual JointActionHistory * | Clone () const |
Returns a pointer to a copy of this class. | |
const std::vector< Index > & | GetIndividualActionHistoryIndices () const |
Returns the indices of the indiv. action histories. | |
JointActionHistory (PlanningUnitMADPDiscrete &pu) | |
Constructor - creates a new initial (=empty) 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 (Index jObsI, JointActionHistory *pred) | |
Creates a action history specifying jObsI for the last joint action and pred as the preceeding JointActionHistory. | |
JointActionHistory (const JointActionHistory &a) | |
Copy constructor. | |
void | Print () const |
Prints the joint observation history. | |
std::string | SoftPrint () const |
SoftPrints the joint observation history. | |
~JointActionHistory () | |
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. | |
![]() | |
JointHistory () | |
(default) Constructor | |
virtual | ~JointHistory () |
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 | |
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. | |
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. | |
Index | _m_jointActionI |
The last joint action (index). | |
JointActionHistory * | _m_pred |
The predecessor joint belief. |
Additional Inherited Members | |
![]() | |
size_t | _m_length |
How long (how many time-steps) is this history? |
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.
Definition at line 49 of file JointActionHistory.h.
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.
Definition at line 38 of file JointActionHistory.cpp.
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)
Definition at line 48 of file JointActionHistory.cpp.
JointActionHistory::JointActionHistory | ( | Index | jObsI, |
JointActionHistory * | pred | ||
) |
Creates a action history specifying jObsI for the last joint action and pred as the preceeding JointActionHistory.
Definition at line 54 of file JointActionHistory.cpp.
References _m_individualActionHistories, _m_isEmpty, _m_jointActionI, _m_pred, History::GetLength(), Referrer< PlanningUnitMADPDiscrete >::GetReferred(), and History::SetLength().
JointActionHistory::JointActionHistory | ( | const JointActionHistory & | a | ) |
Copy constructor.
Definition at line 89 of file JointActionHistory.cpp.
JointActionHistory::~JointActionHistory | ( | ) |
Destructor.
Definition at line 95 of file JointActionHistory.cpp.
|
inlinevirtual |
Returns a pointer to a copy of this class.
Implements History.
Definition at line 99 of file JointActionHistory.h.
References JointActionHistory().
const vector< Index > & JointActionHistory::GetIndividualActionHistoryIndices | ( | ) | const |
Returns the indices of the indiv. action histories.
Definition at line 103 of file JointActionHistory.cpp.
References _m_individualActionHistories.
|
inlinevirtual |
Prints the joint observation history.
Implements History.
Definition at line 105 of file JointActionHistory.h.
References SoftPrint().
Referenced by PlanningUnitMADPDiscrete::InitializeJointActionHistories(), JointActionHistory(), and ~JointActionHistory().
string JointActionHistory::SoftPrint | ( | ) | const |
SoftPrints the joint observation history.
Definition at line 108 of file JointActionHistory.cpp.
References _m_isEmpty, _m_jointActionI, History::_m_length, _m_pred, PlanningUnitMADPDiscrete::GetJointAction(), Referrer< PlanningUnitMADPDiscrete >::GetReferred(), SoftPrint(), and JointAction::SoftPrintBrief().
Referenced by Print(), and SoftPrint().
|
private |
A vector of ints which are the indices of individual ActionHistories this gives an alternate description of the current JointAction History.
Definition at line 68 of file JointActionHistory.h.
Referenced by GetIndividualActionHistoryIndices(), and JointActionHistory().
|
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.
Definition at line 60 of file JointActionHistory.h.
Referenced by JointActionHistory(), and SoftPrint().
|
private |
The last joint action (index).
Definition at line 55 of file JointActionHistory.h.
Referenced by JointActionHistory(), and SoftPrint().
|
private |
The predecessor joint belief.
Together with the last joint action(_m_jointActionI) this gives a full description of this joint action history.
Definition at line 64 of file JointActionHistory.h.
Referenced by JointActionHistory(), and SoftPrint().