MultiAgentDecisionProcess
JointActionDiscrete Class Reference

JointActionDiscrete represents discrete joint actions. More...

#include <JointActionDiscrete.h>

Inheritance diagram for JointActionDiscrete:
[legend]

Public Member Functions

void AddIndividualAction (const ActionDiscrete *a, Index agentI)
 Adds an individual action for agentI to this joint action. More...
 
virtual JointActionDiscreteClone () const
 Returns a pointer to a copy of this class. More...
 
void DeleteIndividualActions ()
 Deletes the individual actions to which this joint action points. More...
 
const std::vector< const
ActionDiscrete * > & 
GetIndividualActionDiscretes () const
 Get the ActionDiscretes for this joint action. More...
 
const std::vector< Index > & GetIndividualActionDiscretesIndices () const
 Get the Action indices for this joint action. More...
 
 JointActionDiscrete (Index index=INDEX_MAX)
 (default) Constructor More...
 
 JointActionDiscrete (Index index, std::vector< const ActionDiscrete * > a)
 Constructor with an index and a vector of individual actions. More...
 
 JointActionDiscrete (const JointActionDiscrete &a)
 Copy constructor. More...
 
std::string SoftPrint () const
 
std::string SoftPrintBrief () const
 
virtual ~JointActionDiscrete ()
 Destructor. More...
 
- Public Member Functions inherited from JointAction
virtual void Print () const
 
virtual void PrintBrief () const
 
virtual ~JointAction ()
 Destructor. More...
 
- Public Member Functions inherited from DiscreteEntity
 DiscreteEntity (Index i=INDEX_MAX)
 (default) Constructor More...
 
Index GetIndex () const
 Return this DiscreteEntity's index. More...
 
bool operator< (const DiscreteEntity &a) const
 The less (<) operator. This is needed to put DiscreteEntities in a set. More...
 
void SetIndex (Index i)
 Set this DiscreteEntity's index. More...
 
virtual ~DiscreteEntity ()
 Destructor. More...
 

Private Member Functions

std::vector< IndexConstructIndividualActionDiscretesIndices () const
 Constructs the vector of individual Action indices from _m_apVector. More...
 

Private Attributes

std::vector< Index_m_aIndexVector
 Pointers to the individual actions that make up this joint action. More...
 
std::vector< const
ActionDiscrete * > 
_m_apVector
 Indices of the individual actions that make up this joint action. More...
 

Detailed Description

JointActionDiscrete represents discrete joint actions.

Constructor & Destructor Documentation

JointActionDiscrete::JointActionDiscrete ( Index  index = INDEX_MAX)

(default) Constructor

Referenced by Clone().

JointActionDiscrete::JointActionDiscrete ( Index  index,
std::vector< const ActionDiscrete * >  a 
)

Constructor with an index and a vector of individual actions.

References _m_aIndexVector, and ConstructIndividualActionDiscretesIndices().

JointActionDiscrete::JointActionDiscrete ( const JointActionDiscrete a)

Copy constructor.

References _m_aIndexVector, _m_apVector, and DEBUG_JAD.

JointActionDiscrete::~JointActionDiscrete ( )
virtual

Destructor.

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.

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.

References JointActionDiscrete().

vector< Index > JointActionDiscrete::ConstructIndividualActionDiscretesIndices ( ) const
private

Constructs the vector of individual Action indices from _m_apVector.

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

References _m_apVector.

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

Get the ActionDiscretes for this joint action.

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

Implements JointAction.

References _m_apVector, and DiscreteEntity::GetIndex().

string JointActionDiscrete::SoftPrintBrief ( ) const
virtual

Implements JointAction.

References _m_apVector.

Member Data Documentation

std::vector<Index> JointActionDiscrete::_m_aIndexVector
private

Pointers to the individual actions that make up this joint action.

Referenced by AddIndividualAction(), and JointActionDiscrete().

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