MultiAgentDecisionProcess  Release 0.2.1
JointActionDiscrete Class Reference

JointActionDiscrete represents discrete joint actions. More...

#include <JointActionDiscrete.h>

+ Inheritance diagram for JointActionDiscrete:
+ Collaboration diagram for JointActionDiscrete:

Public Member Functions

void AddIndividualAction (const ActionDiscrete *a, Index agentI)
 Adds an individual action for agentI to this joint action.
virtual JointActionDiscreteClone () 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.
- Public Member Functions inherited from JointAction
virtual void Print () const
virtual void PrintBrief () const
virtual ~JointAction ()
 Destructor.
- Public Member Functions inherited from DiscreteEntity
 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

- Protected Attributes inherited from DiscreteEntity
Index _m_index
 The index of this discrete entity.

Detailed Description

JointActionDiscrete represents discrete joint actions.

Definition at line 42 of file JointActionDiscrete.h.

Constructor & Destructor Documentation

JointActionDiscrete::JointActionDiscrete ( Index  index = 0)

(default) Constructor

Definition at line 36 of file JointActionDiscrete.cpp.

Referenced by Clone().

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.

Member Function Documentation

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().

virtual JointActionDiscrete* JointActionDiscrete::Clone ( ) const
inlinevirtual

Returns a pointer to a copy of this class.

Implements JointAction.

Definition at line 91 of file JointActionDiscrete.h.

References JointActionDiscrete().

vector< Index > JointActionDiscrete::ConstructIndividualActionDiscretesIndices ( ) const
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.

const std::vector<const ActionDiscrete*>& JointActionDiscrete::GetIndividualActionDiscretes ( ) const
inline

Get the ActionDiscretes for this joint action.

Definition at line 85 of file JointActionDiscrete.h.

References _m_apVector.

const std::vector<Index>& JointActionDiscrete::GetIndividualActionDiscretesIndices ( ) const
inline

Get the Action indices for this joint action.

Definition at line 88 of file JointActionDiscrete.h.

References _m_aIndexVector.

Referenced by TransitionObservationIndependentMADPDiscrete::JointToIndividualActionIndicesNoCache().

string JointActionDiscrete::SoftPrint ( ) const
virtual

Implements JointAction.

Definition at line 100 of file JointActionDiscrete.cpp.

References _m_apVector, and DiscreteEntity::GetIndex().

string JointActionDiscrete::SoftPrintBrief ( ) const
virtual

Implements JointAction.

Definition at line 117 of file JointActionDiscrete.cpp.

References _m_apVector.

Member Data Documentation

std::vector<Index> JointActionDiscrete::_m_aIndexVector
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().

std::vector<const ActionDiscrete*> JointActionDiscrete::_m_apVector
private

The documentation for this class was generated from the following files: