MultiAgentDecisionProcess
|
PartialJointPolicyPureVector implements a PartialJointPolicy using a mapping of history indices to actions. More...
#include <PartialJointPolicyPureVector.h>
Public Member Functions | |
virtual PartialJointPolicyPureVector * | Clone () const |
Returns a pointer to a copy of this class. More... | |
virtual Index | GetActionIndex (Index agI, Index domainI) const |
Returns the action index for domainI for agent aI. More... | |
LIndex | GetIndex () const |
std::vector< PolicyPureVector * > & | GetIndividualPolicies () |
Returns a reference to the vector of pointers to individual policies. More... | |
virtual PolicyDiscrete * | GetIndividualPolicyDiscrete (Index i) const |
virtual Index | GetJointActionIndex (Index i) const |
Returns the jaI taken by this policy for joint domain index johI. More... | |
virtual Index | GetJointActionIndex (LIndex i) const |
Returns the jaI taken by this policy for joint domain index johI. More... | |
bool | Increment (Index agentI) |
bool | Increment () |
bool | operator++ () |
bool | operator< (const JointPolicy &o) const |
less-than operator. More... | |
bool | operator< (const PartialJointPolicyPureVector &o) const |
virtual PartialJointPolicyPureVector & | operator= (const PartialJointPolicyPureVector &o) |
Copy assignment operator. More... | |
virtual PartialJointPolicyPureVector & | operator= (const PartialJointPolicyDiscretePure &o) |
Copy assignment operator. More... | |
PartialJointPolicyPureVector (const Interface_ProblemToPolicyDiscretePure *pu, PolicyGlobals::PolicyDomainCategory idc, double pastReward=0.0, size_t depth=MAXHORIZON) | |
PartialJointPolicyPureVector (const I_PtPDpure_constPtr &pu, PolicyGlobals::PolicyDomainCategory idc, double pastReward=0.0, size_t depth=MAXHORIZON) | |
PartialJointPolicyPureVector (const PartialJointPolicyPureVector &a) | |
Copy constructor. More... | |
PartialJointPolicyPureVector (const PartialJointPolicyDiscretePure &a) | |
void | PrintBrief () const |
virtual void | RandomInitialization () |
Randomly initialize the joint policy. More... | |
virtual void | RandomInitialization (Index i) |
Randomly initialize the policy for agentI. More... | |
virtual void | SetAction (Index agentI, Index domainI, Index aI) |
Sets the policy for agentI to domainI->aI. More... | |
void | SetDepth (size_t d) |
Sets the depth of the joint policy. More... | |
void | SetIndex (LIndex i) |
virtual std::string | SoftPrint () const |
Prints a description of this JointPolicyPureVector to a string. More... | |
virtual std::string | SoftPrintBrief () const |
Prints a brief description to a string. More... | |
virtual boost::shared_ptr < JointPolicyPureVector > | ToJointPolicyPureVector () const |
Convert this joint policy to a JointPolicyPureVector. More... | |
virtual void | ZeroInitialization () |
virtual void | ZeroInitialization (Index i) |
virtual | ~PartialJointPolicyPureVector () |
Destructor. More... | |
Public Member Functions inherited from PartialJointPolicyDiscretePure | |
PartialJointPolicyDiscretePure () | |
(default) Constructor More... | |
PartialJointPolicyDiscretePure (const Interface_ProblemToPolicyDiscretePure *pu, PolicyGlobals::PolicyDomainCategory idc, double pastReward=0.0) | |
PartialJointPolicyDiscretePure (const I_PtPDpure_constPtr &pu, PolicyGlobals::PolicyDomainCategory idc, double pastReward=0.0) | |
PartialJointPolicyDiscretePure (const PartialJointPolicyDiscretePure &a) | |
Copy constructor. More... | |
virtual | ~PartialJointPolicyDiscretePure () |
Destructor. More... | |
Public Member Functions inherited from JointPolicyDiscretePure | |
double | GetActionProb (Index agentI, Index domI, Index aI) const |
Returns the probability that the policy specifies action aI for domain index domI for agentI. More... | |
const Interface_ProblemToPolicyDiscretePure * | GetInterfacePTPDiscretePure () const |
Return pointer to the Interface_ProblemToPolicyDiscretePure. More... | |
boost::shared_ptr< const Interface_ProblemToPolicyDiscretePure > | GetInterfacePTPDiscretePureShared () const |
double | GetJointActionProb (Index i, Index ja) const |
Returns the probability that the policy specifies joint action a for domain index i. More... | |
double | GetJointActionProb (LIndex i, Index ja) const |
Returns the probability that the policy specifies joint action a for domain index i. More... | |
JointPolicyDiscretePure () | |
default Constructor - constructs empty policy More... | |
JointPolicyDiscretePure (const Interface_ProblemToPolicyDiscretePure *pu, PolicyGlobals::PolicyDomainCategory idc) | |
(default) Constructor More... | |
JointPolicyDiscretePure (const I_PtPDpure_constPtr &pu, PolicyGlobals::PolicyDomainCategory idc) | |
JointPolicyDiscretePure (const JointPolicyDiscretePure &a) | |
Copy constructor. More... | |
virtual JointPolicyDiscretePure & | operator= (const JointPolicyDiscretePure &o) |
Copy assignment operator. More... | |
void | SetInterfacePTPDiscretePure (Interface_ProblemToPolicyDiscretePure *pu) |
Sets the planning unit for this joint policy. More... | |
virtual | ~JointPolicyDiscretePure () |
Destructor. More... | |
Public Member Functions inherited from JointPolicyDiscrete | |
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... | |
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 JointPolicy & | operator= (const JointPolicy &o) |
copy assignment operator More... | |
virtual void | Print () const |
Prints a description of a joint policy to cout. More... | |
virtual | ~JointPolicy () |
Destructor. More... | |
Public Member Functions inherited from PartialJointPolicy | |
double | GetPastReward () const |
PartialJointPolicy & | operator= (const PartialJointPolicy &o) |
Destructor. More... | |
PartialJointPolicy (double r=0.0) | |
(default) Constructor More... | |
PartialJointPolicy (const PartialJointPolicy &a) | |
Copy constructor. More... | |
void | SetPastReward (double r) |
Additional Inherited Members | |
Protected Attributes inherited from JointPolicy | |
size_t | _m_nrAgents |
some other numbers we cache: More... | |
Private Member Functions inherited from JPolComponent_VectorImplementation | |
Index | GetActionIndex (Index aI, Index domainI) const |
Returns the action index for domainI for agent aI. More... | |
LIndex | GetIndex () const |
Get the index of this joint policy. More... | |
std::vector< PolicyPureVector * > & | GetIndividualPolicies () |
Returns a reference to the vector of pointers to individual policies. More... | |
Index | GetJointActionIndex (Index i) const |
Returns the jaI taken by this policy for joint domain index johI. More... | |
Index | GetJointActionIndex (LIndex i) const |
Returns the jaI taken by this policy for joint domain index johI. More... | |
bool | Increment (Index agentI) |
Increments the individual policy of agentI. More... | |
bool | Increment () |
Increments the joint policy, used to iterate over joint policies. More... | |
JPolComponent_VectorImplementation (const Interface_ProblemToPolicyDiscretePure *pu, size_t depth=MAXHORIZON) | |
(default) Constructor More... | |
JPolComponent_VectorImplementation (const Interface_ProblemToPolicyDiscretePure *pu, PolicyGlobals::PolicyDomainCategory idc, size_t depth=MAXHORIZON) | |
JPolComponent_VectorImplementation (const I_PtPDpure_constPtr &pu, size_t depth=MAXHORIZON) | |
JPolComponent_VectorImplementation (const I_PtPDpure_constPtr &pu, PolicyGlobals::PolicyDomainCategory idc, size_t depth=MAXHORIZON) | |
JPolComponent_VectorImplementation (const JPolComponent_VectorImplementation &a) | |
Copy constructor. More... | |
bool | operator++ () |
Performs increment. See Increment(). More... | |
JPolComponent_VectorImplementation & | operator= (const JPolComponent_VectorImplementation &o) |
Copy assignment operator. More... | |
void | RandomInitialization () |
Randomly initialize the joint policy. More... | |
void | RandomInitialization (Index agentI) |
Randomly initialize the policy for agentI. More... | |
void | SetAction (Index agentI, Index domainI, Index aI) |
Sets the policy for agentI to domainI->aI. More... | |
void | SetDepthForIndivPols (size_t d) |
void | SetIndex (LIndex i) |
Sets the index of this joint policy.Updates the policies represented. More... | |
std::string | SoftPrint () const |
Prints a description of this to a string. More... | |
std::string | SoftPrintBrief () const |
void | ZeroInitialization () |
Initialize the joint policy to the first joint policy. More... | |
void | ZeroInitialization (Index agentI) |
Initialize the policy of agentI to the first policy. More... | |
~JPolComponent_VectorImplementation () | |
Destructor. More... | |
Private Attributes inherited from JPolComponent_VectorImplementation | |
std::vector< PolicyPureVector * > | _m_indivPols_PolicyPureVector |
PartialJointPolicyPureVector implements a PartialJointPolicy using a mapping of history indices to actions.
PartialJointPolicyPureVector::PartialJointPolicyPureVector | ( | const Interface_ProblemToPolicyDiscretePure * | pu, |
PolicyGlobals::PolicyDomainCategory | idc, | ||
double | pastReward = 0.0 , |
||
size_t | depth = MAXHORIZON |
||
) |
References SetDepth().
Referenced by Clone().
PartialJointPolicyPureVector::PartialJointPolicyPureVector | ( | const I_PtPDpure_constPtr & | pu, |
PolicyGlobals::PolicyDomainCategory | idc, | ||
double | pastReward = 0.0 , |
||
size_t | depth = MAXHORIZON |
||
) |
References SetDepth().
|
inline |
Copy constructor.
|
inline |
|
inlinevirtual |
Destructor.
|
inlinevirtual |
Returns a pointer to a copy of this class.
Implements PartialJointPolicyDiscretePure.
Reimplemented in JointPolicyPureVectorForClusteredBG.
References PartialJointPolicyPureVector().
|
inlinevirtual |
Returns the action index for domainI for agent aI.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::GetActionIndex().
|
inline |
References JPolComponent_VectorImplementation::GetIndex().
Referenced by operator<(), and PartialJPPVIndexValuePair::PartialJPPVIndexValuePair().
|
inline |
Returns a reference to the vector of pointers to individual policies.
This function should be used to manipulate individual policies.
References JPolComponent_VectorImplementation::GetIndividualPolicies().
|
inlinevirtual |
Reimplemented from JPolComponent_VectorImplementation.
References JPolComponent_VectorImplementation::GetIndividualPolicyDiscrete().
Returns the jaI taken by this policy for joint domain index johI.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::GetJointActionIndex().
Referenced by BayesianGameIdenticalPayoffSolver::Evaluate().
Returns the jaI taken by this policy for joint domain index johI.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::GetJointActionIndex().
|
inline |
References JPolComponent_VectorImplementation::Increment().
|
inline |
References JPolComponent_VectorImplementation::Increment().
Referenced by operator++().
|
inline |
References Increment().
|
inlinevirtual |
less-than operator.
In many cases, it will be necessary to order Joint Policies)
Implements JointPolicy.
|
inline |
References GetIndex().
|
virtual |
Copy assignment operator.
Reimplemented in JointPolicyPureVectorForClusteredBG.
References PartialJointPolicyDiscretePure::operator=(), and JPolComponent_VectorImplementation::operator=().
Referenced by operator=(), and JointPolicyPureVectorForClusteredBG::operator=().
|
virtual |
Copy assignment operator.
Reimplemented from PartialJointPolicyDiscretePure.
Reimplemented in JointPolicyPureVectorForClusteredBG.
References operator=().
|
inline |
References SoftPrintBrief().
|
inlinevirtual |
Randomly initialize the joint policy.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::RandomInitialization().
|
inlinevirtual |
Randomly initialize the policy for agentI.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::RandomInitialization().
|
inlinevirtual |
Sets the policy for agentI to domainI->aI.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::SetAction().
|
inlinevirtual |
Sets the depth of the joint policy.
Also sets the depth of each of the invididual policies.
Reimplemented from JointPolicy.
References Globals::MAXHORIZON, JointPolicy::SetDepth(), and JPolComponent_VectorImplementation::SetDepthForIndivPols().
Referenced by GMAA_kGMAACluster::ConstructAndValuateNextPolicies(), PolicyPoolPartialJPolValPair::Init(), and PartialJointPolicyPureVector().
|
inline |
References JPolComponent_VectorImplementation::SetIndex().
Referenced by PartialJPPVIndexValuePair::AllocateJPPV().
|
virtual |
Prints a description of this JointPolicyPureVector to a string.
Implements JointPolicyDiscretePure.
Reimplemented in JointPolicyPureVectorForClusteredBG.
References PartialJointPolicy::GetPastReward(), and JPolComponent_VectorImplementation::SoftPrint().
|
virtual |
Prints a brief description to a string.
Implements JointPolicyDiscretePure.
Reimplemented in JointPolicyPureVectorForClusteredBG.
References PartialJointPolicy::GetPastReward(), and JPolComponent_VectorImplementation::SoftPrintBrief().
Referenced by PrintBrief().
|
virtual |
Convert this joint policy to a JointPolicyPureVector.
Implements JointPolicyDiscretePure.
Reimplemented in JointPolicyPureVectorForClusteredBG.
|
inlinevirtual |
|
inlinevirtual |