MultiAgentDecisionProcess
Release 0.2.1
|
JointActionDiscrete represents discrete joint actions. More...
#include <JointActionDiscrete.h>
Public Member Functions | |
void | AddIndividualAction (const ActionDiscrete *a, Index agentI) |
Adds an individual action for agentI to this joint action. | |
virtual JointActionDiscrete * | Clone () const |
Returns a pointer to a copy of this class. | |
void | DeleteIndividualActions () |
Deletes the individual actions to which this joint action points. | |
const std::vector< const ActionDiscrete * > & | GetIndividualActionDiscretes () const |
Get the ActionDiscretes for this joint action. | |
const std::vector< Index > & | GetIndividualActionDiscretesIndices () const |
Get the Action indices for this joint action. | |
JointActionDiscrete (Index index=0) | |
(default) Constructor | |
JointActionDiscrete (Index index, std::vector< const ActionDiscrete * > a) | |
Constructor with an index and a vector of individual actions. | |
JointActionDiscrete (const JointActionDiscrete &a) | |
Copy constructor. | |
std::string | SoftPrint () const |
std::string | SoftPrintBrief () const |
~JointActionDiscrete () | |
Destructor. | |
![]() | |
virtual void | Print () const |
virtual void | PrintBrief () const |
virtual | ~JointAction () |
Destructor. | |
![]() | |
DiscreteEntity (Index i) | |
(default) Constructor | |
Index | GetIndex () const |
Return this DiscreteEntity's index. | |
bool | operator< (const DiscreteEntity &a) const |
The less (<) operator. This is needed to put DiscreteEntities in a set. | |
void | SetIndex (Index i) |
Set this DiscreteEntity's index. | |
virtual | ~DiscreteEntity () |
Destructor. |
Private Member Functions | |
std::vector< Index > | ConstructIndividualActionDiscretesIndices () const |
Constructs the vector of individual Action indices from _m_apVector. |
Private Attributes | |
std::vector< Index > | _m_aIndexVector |
Pointers to the individual actions that make up this joint action. | |
std::vector< const ActionDiscrete * > | _m_apVector |
Indices of the individual actions that make up this joint action. |
Additional Inherited Members | |
![]() | |
Index | _m_index |
The index of this discrete entity. |
JointActionDiscrete represents discrete joint actions.
Definition at line 42 of file JointActionDiscrete.h.
JointActionDiscrete::JointActionDiscrete | ( | Index | index = 0 | ) |
JointActionDiscrete::JointActionDiscrete | ( | Index | index, |
std::vector< const ActionDiscrete * > | a | ||
) |
Constructor with an index and a vector of individual actions.
Definition at line 41 of file JointActionDiscrete.cpp.
References _m_aIndexVector, and ConstructIndividualActionDiscretesIndices().
JointActionDiscrete::JointActionDiscrete | ( | const JointActionDiscrete & | a | ) |
Copy constructor.
Definition at line 50 of file JointActionDiscrete.cpp.
References _m_aIndexVector, _m_apVector, and DEBUG_JAD.
JointActionDiscrete::~JointActionDiscrete | ( | ) |
Destructor.
Definition at line 67 of file JointActionDiscrete.cpp.
References _m_apVector, and DEBUG_JAD.
void JointActionDiscrete::AddIndividualAction | ( | const ActionDiscrete * | a, |
Index | agentI | ||
) |
Adds an individual action for agentI to this joint action.
This has to be called ordered: i.e., first for agent 0, then for agent 1, etc. up to nrAgents. This function is also typically only used to construct the joint actions.
Definition at line 85 of file JointActionDiscrete.cpp.
References _m_aIndexVector, _m_apVector, and DiscreteEntity::GetIndex().
Referenced by MADPComponentDiscreteActions::ConstructJointActionsRecursively(), TransitionObservationIndependentMADPDiscrete::CreateJointActionsRecursively(), and TransitionObservationIndependentMADPDiscrete::GetJointActionDiscrete().
|
inlinevirtual |
Returns a pointer to a copy of this class.
Implements JointAction.
Definition at line 91 of file JointActionDiscrete.h.
References JointActionDiscrete().
|
private |
Constructs the vector of individual Action indices from _m_apVector.
Definition at line 134 of file JointActionDiscrete.cpp.
References _m_apVector.
Referenced by JointActionDiscrete().
void JointActionDiscrete::DeleteIndividualActions | ( | ) |
Deletes the individual actions to which this joint action points.
This function will typically NOT be used: normally multiple joint actions share their individual actions...
Definition at line 79 of file JointActionDiscrete.cpp.
References _m_apVector.
|
inline |
Get the ActionDiscretes for this joint action.
Definition at line 85 of file JointActionDiscrete.h.
References _m_apVector.
|
inline |
Get the Action indices for this joint action.
Definition at line 88 of file JointActionDiscrete.h.
References _m_aIndexVector.
Referenced by TransitionObservationIndependentMADPDiscrete::JointToIndividualActionIndicesNoCache().
|
virtual |
Implements JointAction.
Definition at line 100 of file JointActionDiscrete.cpp.
References _m_apVector, and DiscreteEntity::GetIndex().
|
virtual |
Implements JointAction.
Definition at line 117 of file JointActionDiscrete.cpp.
References _m_apVector.
|
private |
Pointers to the individual actions that make up this joint action.
Definition at line 48 of file JointActionDiscrete.h.
Referenced by AddIndividualAction(), GetIndividualActionDiscretesIndices(), and JointActionDiscrete().
|
private |
Indices of the individual actions that make up this joint action.
Definition at line 50 of file JointActionDiscrete.h.
Referenced by AddIndividualAction(), ConstructIndividualActionDiscretesIndices(), DeleteIndividualActions(), GetIndividualActionDiscretes(), JointActionDiscrete(), SoftPrint(), SoftPrintBrief(), and ~JointActionDiscrete().