MultiAgentDecisionProcess
JointPolicyDiscrete Class Referenceabstract

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

#include <JointPolicyDiscrete.h>

Inheritance diagram for JointPolicyDiscrete:
[legend]

Public Member Functions

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

Private Attributes

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

Additional Inherited Members

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

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.

Constructor & Destructor Documentation

JointPolicyDiscrete::JointPolicyDiscrete ( )
inline

default constructor creates an empty policy

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

(default) Constructor

JointPolicyDiscrete::JointPolicyDiscrete ( const I_PtPD_constPtr pu,
PolicyGlobals::PolicyDomainCategory  idc 
)
JointPolicyDiscrete::JointPolicyDiscrete ( const JointPolicyDiscrete a)

Copy constructor.

virtual JointPolicyDiscrete::~JointPolicyDiscrete ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual JointPolicyDiscrete* JointPolicyDiscrete::Clone ( ) const
pure virtual
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.

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

return pointer to individual policy of agent agI

Implemented in JointPolicyPureVector, and PartialJointPolicyPureVector.

Referenced by SampleJointActionVector().

const Interface_ProblemToPolicyDiscrete* JointPolicyDiscrete::GetInterfacePTPDiscrete ( ) const
inline
boost::shared_ptr<const Interface_ProblemToPolicyDiscrete> JointPolicyDiscrete::GetInterfacePTPDiscreteShared ( ) const
inline
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().

virtual double JointPolicyDiscrete::GetJointActionProb ( LIndex  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.

size_t JointPolicyDiscrete::GetNrDomainElements ( Index  agentI) const
inline

Returns the number of policy domain elements for agent agentI.

JointPolicyDiscrete & JointPolicyDiscrete::operator= ( const JointPolicyDiscrete o)
virtual
Index JointPolicyDiscrete::SampleJointAction ( Index  i) const

Returns a sampled joint action.

i is the i-th joint domain index

References _m_indexDomCat, and GetInterfacePTPDiscrete().

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

References GetInterfacePTPDiscrete(), 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

References _m_indexDomCat, and GetInterfacePTPDiscrete().

Referenced by SimulationFactoredDecPOMDPDiscrete::RunSimulation(), and 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

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

void JointPolicyDiscrete::SetInterfacePTPDiscrete ( const Interface_ProblemToPolicyDiscrete p)
inline
void JointPolicyDiscrete::SetInterfacePTPDiscrete ( I_PtPD_constPtr  p)
inline

sets the shared pointer to the Interface_ProblemToPolicyDiscrete.

void JointPolicyDiscrete::SetPolicyDomainCategory ( PolicyDomainCategory  idc)
inline

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

Member Data Documentation

PolicyGlobals::PolicyDomainCategory JointPolicyDiscrete::_m_indexDomCat
private

Maintains the PolicyDomainCategory.

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.

Referenced by operator=().

I_PtPD_constPtr JointPolicyDiscrete::_m_PTPDshared
private

Referenced by operator=().