MultiAgentDecisionProcess
|
JointPolicyDiscrete is a class that represents a discrete joint policy. More...
#include <JointPolicyDiscrete.h>
Public Member Functions | |
virtual JointPolicyDiscrete * | Clone () 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 PolicyDiscrete * | GetIndividualPolicyDiscrete (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 JointPolicyDiscrete & | operator= (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 JointPolicy & | operator= (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... | |
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.
|
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.
|
inlinevirtual |
Destructor.
|
pure virtual |
Returns a pointer to a copy of this class.
Implements JointPolicy.
Implemented in JointPolicyPureVector, JointPolicyPureVectorForClusteredBG, PartialJointPolicyPureVector, JointPolicyDiscretePure, and PartialJointPolicyDiscretePure.
|
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.
|
pure virtual |
return pointer to individual policy of agent agI
Implemented in JointPolicyPureVector, and PartialJointPolicyPureVector.
Referenced by SampleJointActionVector().
|
inline |
return a pointer to the referred Interface_ProblemToPolicyDiscrete.
Referenced by JointPolicyDiscretePure::GetInterfacePTPDiscretePure(), SampleJointAction(), and SampleJointActionVector().
|
inline |
return a shared pointer to the referred Interface_ProblemToPolicyDiscrete.
Referenced by JointPolicyDiscretePure::GetInterfacePTPDiscretePureShared().
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().
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.
|
inline |
Returns the number of policy domain elements for agent agentI.
|
inline |
returns the Category of the domain over which the indices of this policy are specified.
Referenced by GeneralizedMAAStarPlannerForDecPOMDPDiscrete::ConstructExtendedJointPolicy(), GeneralizedMAAStarPlannerForFactoredDecPOMDPDiscrete::ConstructExtendedJointPolicy(), BayesianGameForDecPOMDPStage::ConstructExtendedPolicy(), and PlanningUnitMADPDiscrete::GetJAOHProbsRecursively().
|
virtual |
Assignment operator.
Reimplemented in JointPolicyPureVectorForClusteredBG.
References _m_indexDomCat, _m_PTPD, _m_PTPDshared, and JointPolicy::operator=().
Referenced by JointPolicyDiscretePure::operator=().
Returns a sampled joint action.
i is the i-th joint domain index
References _m_indexDomCat, and GetInterfacePTPDiscrete().
Referenced by SimulationDecPOMDPDiscrete::RunSimulation().
Returns a sampled joint action.
Is is the vector of domain indices
References GetInterfacePTPDiscrete(), Interface_ProblemToPolicyDiscrete::IndividualToJointActionIndices(), and SampleJointActionVector().
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().
|
inline |
sets the pointer to the Interface_ProblemToPolicyDiscrete.
Referenced by JointPolicyDiscretePure::SetInterfacePTPDiscretePure().
|
inline |
sets the shared pointer to the Interface_ProblemToPolicyDiscrete.
|
inline |
sets the category of the domain over which the indices of this policy are specified.
|
private |
Maintains the PolicyDomainCategory.
Referenced by operator=(), SampleJointAction(), and SampleJointActionVector().
|
private |
Interface that allows this policy to get some info on the problem.
Referenced by operator=().
|
private |
Referenced by operator=().