MultiAgentDecisionProcess
Release 0.2.1
|
JointActionObservationHistory represents a joint action observation history. More...
#include <JointActionObservationHistory.h>
Public Member Functions | |
virtual JointActionObservationHistory * | Clone () const |
Returns a pointer to a copy of this class. | |
const std::vector< Index > & | GetIndividualActionObservationHistoryIndices () const |
Returns the indices of the indiv. action observation histories. | |
Index | GetJointActionIndex () const |
Gets the last joint action index. | |
void | GetJointActionObservationHistoryVectors (std::vector< Index > &jaIs, std::vector< Index > &joIs) |
Get vectors of joint action and observation indices stored by this history. | |
Index | GetJointObservationIndex () const |
Gets the last joint observation index. | |
JointActionObservationHistory (PlanningUnitMADPDiscrete &pu) | |
(default) Constructor - creates a new initial (=empty) JointActionObservationHistory. | |
JointActionObservationHistory (Index jaI, Index joI, JointActionObservationHistory *pred) | |
Creates the joint action-obs. | |
void | Print () const |
Prints the history. | |
std::string | SoftPrint () const |
SoftPrints the history. | |
std::string | SoftPrintJointIndices () const |
SoftPrints the history in terms of joint action/observation indices. | |
![]() | |
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 Member Functions | |
void | GetJointActionObservationHistoryVectorsRecursive (std::vector< Index > &jaIs, std::vector< Index > &joIs) |
Private Attributes | |
std::vector< Index > | _m_individualActionObservationHistories |
A vector of Indices which are the indices of individual ActionObservationHistories this gives an alternate description of the current JointActionObservation History. | |
Index | _m_jaI |
The last joint action (index). | |
Index | _m_joI |
The last joint observation (index). | |
JointActionObservationHistory * | _m_pred |
The predecessor together with the last joint actionObservation (_m_actionObservationI) this gives a full description of this joint actionObservation history. |
Additional Inherited Members | |
![]() | |
size_t | _m_length |
How long (how many time-steps) is this history? |
JointActionObservationHistory represents a joint action observation history.
Definition at line 42 of file JointActionObservationHistory.h.
JointActionObservationHistory::JointActionObservationHistory | ( | PlanningUnitMADPDiscrete & | pu | ) |
(default) Constructor - creates a new initial (=empty) JointActionObservationHistory.
Definition at line 41 of file JointActionObservationHistory.cpp.
References _m_individualActionObservationHistories, _m_jaI, _m_joI, _m_pred, PlanningUnitMADPDiscrete::GetNrAgents(), Referrer< PlanningUnitMADPDiscrete >::GetReferred(), and History::SetLength().
Referenced by Clone().
JointActionObservationHistory::JointActionObservationHistory | ( | Index | jaI, |
Index | joI, | ||
JointActionObservationHistory * | pred | ||
) |
Creates the joint action-obs.
history resulting from joint action jaI and obs. joI after JointActionObservationHistory pred.
Definition at line 53 of file JointActionObservationHistory.cpp.
References _m_individualActionObservationHistories, _m_jaI, _m_joI, _m_pred, GetIndividualActionObservationHistoryIndices(), History::GetLength(), PlanningUnitMADPDiscrete::GetNrAgents(), Referrer< PlanningUnitMADPDiscrete >::GetReferred(), PlanningUnitMADPDiscrete::JointToIndividualActionIndices(), PlanningUnitMADPDiscrete::JointToIndividualObservationIndices(), and History::SetLength().
|
inlinevirtual |
Returns a pointer to a copy of this class.
Implements History.
Definition at line 110 of file JointActionObservationHistory.h.
References JointActionObservationHistory().
|
inline |
Returns the indices of the indiv. action observation histories.
Definition at line 85 of file JointActionObservationHistory.h.
References _m_individualActionObservationHistories.
Referenced by JointActionObservationHistory().
|
inline |
Gets the last joint action index.
Definition at line 103 of file JointActionObservationHistory.h.
References _m_jaI.
void JointActionObservationHistory::GetJointActionObservationHistoryVectors | ( | std::vector< Index > & | jaIs, |
std::vector< Index > & | joIs | ||
) |
Get vectors of joint action and observation indices stored by this history.
Definition at line 157 of file JointActionObservationHistory.cpp.
References GetJointActionObservationHistoryVectorsRecursive(), SoftPrint(), and PrintTools::SoftPrintVector().
|
private |
Definition at line 183 of file JointActionObservationHistory.cpp.
References _m_jaI, _m_joI, History::_m_length, _m_pred, and GetJointActionObservationHistoryVectorsRecursive().
Referenced by GetJointActionObservationHistoryVectors(), and GetJointActionObservationHistoryVectorsRecursive().
|
inline |
Gets the last joint observation index.
Definition at line 106 of file JointActionObservationHistory.h.
References _m_joI.
|
inlinevirtual |
Prints the history.
Implements History.
Definition at line 95 of file JointActionObservationHistory.h.
References SoftPrint().
Referenced by PlanningUnitMADPDiscrete::InitializeJointActionObservationHistories(), JointActionObservationHistoryTree::Print(), and BayesianGameForDecPOMDPStage::ProbRewardForjoahI().
string JointActionObservationHistory::SoftPrint | ( | ) | const |
SoftPrints the history.
Definition at line 83 of file JointActionObservationHistory.cpp.
References _m_jaI, _m_joI, History::_m_length, _m_pred, PlanningUnitMADPDiscrete::GetJointAction(), PlanningUnitMADPDiscrete::GetJointObservation(), Referrer< PlanningUnitMADPDiscrete >::GetReferred(), SoftPrint(), JointObservation::SoftPrintBrief(), and JointAction::SoftPrintBrief().
Referenced by PlanningUnitMADPDiscrete::GetJAOHProbs(), GetJointActionObservationHistoryVectors(), Print(), and SoftPrint().
string JointActionObservationHistory::SoftPrintJointIndices | ( | ) | const |
SoftPrints the history in terms of joint action/observation indices.
Definition at line 117 of file JointActionObservationHistory.cpp.
References _m_jaI, _m_joI, History::_m_length, _m_pred, IndexTools::ActionAndObservation_to_ActionObservationIndex(), Referrer< PlanningUnitMADPDiscrete >::GetReferred(), and SoftPrintJointIndices().
Referenced by SoftPrintJointIndices().
|
private |
A vector of Indices which are the indices of individual ActionObservationHistories this gives an alternate description of the current JointActionObservation History.
Definition at line 60 of file JointActionObservationHistory.h.
Referenced by GetIndividualActionObservationHistoryIndices(), and JointActionObservationHistory().
|
private |
The last joint action (index).
Definition at line 48 of file JointActionObservationHistory.h.
Referenced by GetJointActionIndex(), GetJointActionObservationHistoryVectorsRecursive(), JointActionObservationHistory(), SoftPrint(), and SoftPrintJointIndices().
|
private |
The last joint observation (index).
Definition at line 50 of file JointActionObservationHistory.h.
Referenced by GetJointActionObservationHistoryVectorsRecursive(), GetJointObservationIndex(), JointActionObservationHistory(), SoftPrint(), and SoftPrintJointIndices().
|
private |
The predecessor together with the last joint actionObservation (_m_actionObservationI) this gives a full description of this joint actionObservation history.
Definition at line 55 of file JointActionObservationHistory.h.
Referenced by GetJointActionObservationHistoryVectorsRecursive(), JointActionObservationHistory(), SoftPrint(), and SoftPrintJointIndices().