MultiAgentDecisionProcess
Release 0.2.1
|
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. | |
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 PolicyDiscrete * | GetIndividualPolicyDiscrete (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 JointPolicyDiscrete & | operator= (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. | |
![]() | |
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 JointPolicy & | operator= (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 | |
![]() | |
size_t | _m_nrAgents |
some other numbers we cache: |
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.
|
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.
|
inlinevirtual |
Destructor.
Definition at line 82 of file JointPolicyDiscrete.h.
|
pure virtual |
Returns a pointer to a copy of this class.
Implements JointPolicy.
Implemented in JointPolicyDiscretePure.
|
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.
|
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().
|
pure virtual |
return pointer to individual policy of agent agI
Referenced by SampleJointActionVector().
|
inline |
return a pointer to the referred Interface_ProblemToPolicyDiscrete.
Definition at line 140 of file JointPolicyDiscrete.h.
Referenced by JointPolicyDiscretePure::GetInterfacePTPDiscretePure().
|
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().
|
inline |
Returns the number of policy domain elements for agent agentI.
Definition at line 149 of file JointPolicyDiscrete.h.
|
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().
|
inline |
sets the category of the domain over which the indices of this policy are specified.
Definition at line 93 of file JointPolicyDiscrete.h.
|
inline |
sets the pointer to the Interface_ProblemToPolicyDiscrete.
Definition at line 144 of file JointPolicyDiscrete.h.
Referenced by JointPolicyDiscretePure::SetInterfacePTPDiscretePure().
|
private |
Maintains the IndexDomainCategory.
Definition at line 62 of file JointPolicyDiscrete.h.
Referenced by operator=(), SampleJointAction(), and SampleJointActionVector().
|
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().