MultiAgentDecisionProcess  Release 0.2.1
JointPolicyDiscrete Class Reference

JointPolicyDiscrete is a class that represents a discrete joint policy. More...

#include <JointPolicyDiscrete.h>

+ Inheritance diagram for JointPolicyDiscrete:
+ Collaboration diagram for JointPolicyDiscrete:

Public Member Functions

virtual JointPolicyDiscreteClone () const =0
 Returns a pointer to a copy of this class.
virtual double GetActionProb (Index agentI, Index domI, Index aI) const =0
 Returns the probability that the policy of agentI specifies action aI for domain index domI.
IndexDomainCategory GetIndexDomainCategory () const
 returns the Category of the domain over which the indices of this policy are specified.
virtual PolicyDiscreteGetIndividualPolicyDiscrete (Index agI) const =0
 return pointer to individual policy of agent agI
const
Interface_ProblemToPolicyDiscrete
GetInterfacePTPDiscrete () const
 return a pointer to the referred Interface_ProblemToPolicyDiscrete.
virtual double GetJointActionProb (Index i, Index ja) const =0
 Returns the probability that the policy specifies joint action for joint domain index i.
size_t GetNrDomainElements (Index agentI) const
 Returns the number of policy domain elements for agent agentI.
 JointPolicyDiscrete ()
 default constructor creates an empty policy
 JointPolicyDiscrete (const Interface_ProblemToPolicyDiscrete &pu, PolicyGlobals::IndexDomainCategory idc)
 (default) Constructor
 JointPolicyDiscrete (const JointPolicyDiscrete &a)
 Copy constructor.
virtual JointPolicyDiscreteoperator= (const JointPolicyDiscrete &o)
 Assignment operator.
Index SampleJointAction (Index i) const
 Returns a sampled joint action.
Index SampleJointAction (const std::vector< Index > &Is) const
 Returns a sampled joint action.
void SampleJointActionVector (Index i, std::vector< Index > &jaVec) const
 Returns a sampled joint action.
void SampleJointActionVector (const std::vector< Index > &Is, std::vector< Index > &jaVec) const
 Returns a sampled joint action.
void SetIndexDomainCategory (IndexDomainCategory idc)
 sets the category of the domain over which the indices of this policy are specified.
void SetInterfacePTPDiscrete (const Interface_ProblemToPolicyDiscrete *p)
 sets the pointer to the Interface_ProblemToPolicyDiscrete.
virtual ~JointPolicyDiscrete ()
 Destructor.
- Public Member Functions inherited from JointPolicy
size_t GetDepth () const
 Returns the depth of the joint policy.
size_t GetNrAgents () const
 Returns the number of agents for which the joint policy is defined.
 JointPolicy (size_t nrAg)
 Constructor, initializes the depth to the maximum horizon.
 JointPolicy (const JointPolicy &o)
 copy constructor:
virtual JointPolicyoperator= (const JointPolicy &o)
 copy assignment operator
virtual void Print () const
 Prints a description of a joint policy to cout.
virtual void SetDepth (size_t d)
 Sets the depth of the joint policy.
virtual std::string SoftPrint () const =0
 Prints a description of a joint policy to a string.
virtual ~JointPolicy ()
 Destructor.

Private Attributes

PolicyGlobals::IndexDomainCategory _m_indexDomCat
 Maintains the IndexDomainCategory.
const
Interface_ProblemToPolicyDiscrete
_m_PTPD
 Interface that allows this policy to get some info on the problem.

Additional Inherited Members

- Protected Attributes inherited from JointPolicy
size_t _m_nrAgents
 some other numbers we cache:

Detailed Description

JointPolicyDiscrete is a class that represents a discrete joint policy.

A `discrete joint policy' is a policy for a discrete problem. I.e., the problem specifies, for each agent, a discrete domain for the policy and discrete actions.

A JointPolicyDiscrete from discrete indices over the domain (typically action-observation histories or types) to (degenerate) probability distributions over indices over (joint) actions.

This means that this class includes both pure and stochastic pure policies.

Definition at line 58 of file JointPolicyDiscrete.h.

Constructor & Destructor Documentation

JointPolicyDiscrete::JointPolicyDiscrete ( )
inline

default constructor creates an empty policy

Definition at line 71 of file JointPolicyDiscrete.h.

JointPolicyDiscrete::JointPolicyDiscrete ( const Interface_ProblemToPolicyDiscrete pu,
PolicyGlobals::IndexDomainCategory  idc 
)

(default) Constructor

Definition at line 33 of file JointPolicyDiscrete.cpp.

References JointPolicy::_m_nrAgents, _m_PTPD, and Interface_ProblemToPolicyDiscrete::GetNrAgents().

JointPolicyDiscrete::JointPolicyDiscrete ( const JointPolicyDiscrete a)

Copy constructor.

Definition at line 44 of file JointPolicyDiscrete.cpp.

virtual JointPolicyDiscrete::~JointPolicyDiscrete ( )
inlinevirtual

Destructor.

Definition at line 82 of file JointPolicyDiscrete.h.

Member Function Documentation

virtual JointPolicyDiscrete* JointPolicyDiscrete::Clone ( ) const
pure virtual

Returns a pointer to a copy of this class.

Implements JointPolicy.

Implemented in JointPolicyDiscretePure.

virtual double JointPolicyDiscrete::GetActionProb ( Index  agentI,
Index  domI,
Index  aI 
) const
pure virtual

Returns the probability that the policy of agentI specifies action aI for domain index domI.

Implementations for pure policies clearly should return 0 or 1.

Implemented in JointPolicyDiscretePure.

IndexDomainCategory JointPolicyDiscrete::GetIndexDomainCategory ( ) const
inline

returns the Category of the domain over which the indices of this policy are specified.

Definition at line 100 of file JointPolicyDiscrete.h.

Referenced by GeneralizedMAAStarPlannerForDecPOMDPDiscrete::ConstructExtendedJointPolicy(), BayesianGameForDecPOMDPStage::ConstructExtendedPolicy(), and PlanningUnitMADPDiscrete::GetJAOHProbsRecursively().

virtual PolicyDiscrete* JointPolicyDiscrete::GetIndividualPolicyDiscrete ( Index  agI) const
pure virtual

return pointer to individual policy of agent agI

Referenced by SampleJointActionVector().

const Interface_ProblemToPolicyDiscrete* JointPolicyDiscrete::GetInterfacePTPDiscrete ( ) const
inline

return a pointer to the referred Interface_ProblemToPolicyDiscrete.

Definition at line 140 of file JointPolicyDiscrete.h.

Referenced by JointPolicyDiscretePure::GetInterfacePTPDiscretePure().

virtual double JointPolicyDiscrete::GetJointActionProb ( Index  i,
Index  ja 
) const
pure virtual

Returns the probability that the policy specifies joint action for joint domain index i.

Implementations for pure policies clearly should return 0 or 1.

Implemented in JointPolicyDiscretePure.

Referenced by PlanningUnitMADPDiscrete::GetJAOHProbsRecursively().

size_t JointPolicyDiscrete::GetNrDomainElements ( Index  agentI) const
inline

Returns the number of policy domain elements for agent agentI.

Definition at line 149 of file JointPolicyDiscrete.h.

JointPolicyDiscrete & JointPolicyDiscrete::operator= ( const JointPolicyDiscrete o)
virtual

Assignment operator.

Definition at line 53 of file JointPolicyDiscrete.cpp.

References _m_indexDomCat, and _m_PTPD.

Index JointPolicyDiscrete::SampleJointAction ( Index  i) const

Returns a sampled joint action.

i is the i-th joint domain index

Definition at line 105 of file JointPolicyDiscrete.cpp.

References _m_indexDomCat, _m_PTPD, and Interface_ProblemToPolicyDiscrete::AreCachedJointToIndivIndices().

Referenced by SimulationDecPOMDPDiscrete::RunSimulation().

Index JointPolicyDiscrete::SampleJointAction ( const std::vector< Index > &  Is) const

Returns a sampled joint action.

Is is the vector of domain indices

Definition at line 77 of file JointPolicyDiscrete.cpp.

References _m_PTPD, Interface_ProblemToPolicyDiscrete::IndividualToJointActionIndices(), and SampleJointActionVector().

void JointPolicyDiscrete::SampleJointActionVector ( Index  i,
std::vector< Index > &  jaVec 
) const

Returns a sampled joint action.

i is the i-th joint domain index

Definition at line 87 of file JointPolicyDiscrete.cpp.

References _m_indexDomCat, _m_PTPD, and Interface_ProblemToPolicyDiscrete::AreCachedJointToIndivIndices().

Referenced by SampleJointAction().

void JointPolicyDiscrete::SampleJointActionVector ( const std::vector< Index > &  Is,
std::vector< Index > &  jaVec 
) const

Returns a sampled joint action.

Is is the vector of domain indices

Definition at line 63 of file JointPolicyDiscrete.cpp.

References JointPolicy::_m_nrAgents, GetIndividualPolicyDiscrete(), and PolicyDiscrete::SampleAction().

void JointPolicyDiscrete::SetIndexDomainCategory ( IndexDomainCategory  idc)
inline

sets the category of the domain over which the indices of this policy are specified.

Definition at line 93 of file JointPolicyDiscrete.h.

void JointPolicyDiscrete::SetInterfacePTPDiscrete ( const Interface_ProblemToPolicyDiscrete p)
inline

Member Data Documentation

PolicyGlobals::IndexDomainCategory JointPolicyDiscrete::_m_indexDomCat
private

Maintains the IndexDomainCategory.

Definition at line 62 of file JointPolicyDiscrete.h.

Referenced by operator=(), SampleJointAction(), and SampleJointActionVector().

const Interface_ProblemToPolicyDiscrete* JointPolicyDiscrete::_m_PTPD
private

Interface that allows this policy to get some info on the problem.

Definition at line 64 of file JointPolicyDiscrete.h.

Referenced by JointPolicyDiscrete(), operator=(), SampleJointAction(), and SampleJointActionVector().


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