MultiAgentDecisionProcess
PartialJointPolicyPureVector Class Reference

PartialJointPolicyPureVector implements a PartialJointPolicy using a mapping of history indices to actions. More...

#include <PartialJointPolicyPureVector.h>

Inheritance diagram for PartialJointPolicyPureVector:
[legend]

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 PolicyDiscreteGetIndividualPolicyDiscrete (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 JointPolicyDiscretePureoperator= (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 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 JointPolicyoperator= (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
 
PartialJointPolicyoperator= (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_VectorImplementationoperator= (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
 

Detailed Description

PartialJointPolicyPureVector implements a PartialJointPolicy using a mapping of history indices to actions.

Constructor & Destructor Documentation

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().

PartialJointPolicyPureVector::PartialJointPolicyPureVector ( const PartialJointPolicyPureVector a)
inline

Copy constructor.

PartialJointPolicyPureVector::PartialJointPolicyPureVector ( const PartialJointPolicyDiscretePure a)
inline
virtual PartialJointPolicyPureVector::~PartialJointPolicyPureVector ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual PartialJointPolicyPureVector* PartialJointPolicyPureVector::Clone ( ) const
inlinevirtual

Returns a pointer to a copy of this class.

Implements PartialJointPolicyDiscretePure.

Reimplemented in JointPolicyPureVectorForClusteredBG.

References PartialJointPolicyPureVector().

virtual Index PartialJointPolicyPureVector::GetActionIndex ( Index  aI,
Index  domainI 
) const
inlinevirtual

Returns the action index for domainI for agent aI.

Implements JointPolicyDiscretePure.

References JPolComponent_VectorImplementation::GetActionIndex().

LIndex PartialJointPolicyPureVector::GetIndex ( ) const
inline
std::vector<PolicyPureVector*>& PartialJointPolicyPureVector::GetIndividualPolicies ( )
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().

virtual PolicyDiscrete* PartialJointPolicyPureVector::GetIndividualPolicyDiscrete ( Index  i) const
inlinevirtual
virtual Index PartialJointPolicyPureVector::GetJointActionIndex ( Index  i) const
inlinevirtual

Returns the jaI taken by this policy for joint domain index johI.

Implements JointPolicyDiscretePure.

References JPolComponent_VectorImplementation::GetJointActionIndex().

Referenced by BayesianGameIdenticalPayoffSolver::Evaluate().

virtual Index PartialJointPolicyPureVector::GetJointActionIndex ( LIndex  i) const
inlinevirtual

Returns the jaI taken by this policy for joint domain index johI.

Implements JointPolicyDiscretePure.

References JPolComponent_VectorImplementation::GetJointActionIndex().

bool PartialJointPolicyPureVector::Increment ( Index  agentI)
inline
bool PartialJointPolicyPureVector::Increment ( )
inline
bool PartialJointPolicyPureVector::operator++ ( )
inline

References Increment().

bool PartialJointPolicyPureVector::operator< ( const JointPolicy o) const
inlinevirtual

less-than operator.

In many cases, it will be necessary to order Joint Policies)

Implements JointPolicy.

bool PartialJointPolicyPureVector::operator< ( const PartialJointPolicyPureVector o) const
inline

References GetIndex().

PartialJointPolicyPureVector & PartialJointPolicyPureVector::operator= ( const PartialJointPolicyDiscretePure o)
virtual

Copy assignment operator.

Reimplemented from PartialJointPolicyDiscretePure.

Reimplemented in JointPolicyPureVectorForClusteredBG.

References operator=().

void PartialJointPolicyPureVector::PrintBrief ( ) const
inline

References SoftPrintBrief().

virtual void PartialJointPolicyPureVector::RandomInitialization ( )
inlinevirtual

Randomly initialize the joint policy.

Implements JointPolicyDiscretePure.

References JPolComponent_VectorImplementation::RandomInitialization().

virtual void PartialJointPolicyPureVector::RandomInitialization ( Index  agentI)
inlinevirtual

Randomly initialize the policy for agentI.

Implements JointPolicyDiscretePure.

References JPolComponent_VectorImplementation::RandomInitialization().

virtual void PartialJointPolicyPureVector::SetAction ( Index  agentI,
Index  domainI,
Index  aI 
)
inlinevirtual

Sets the policy for agentI to domainI->aI.

Implements JointPolicyDiscretePure.

References JPolComponent_VectorImplementation::SetAction().

void PartialJointPolicyPureVector::SetDepth ( size_t  d)
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().

void PartialJointPolicyPureVector::SetIndex ( LIndex  i)
inline
string PartialJointPolicyPureVector::SoftPrint ( void  ) const
virtual
string PartialJointPolicyPureVector::SoftPrintBrief ( void  ) const
virtual

Prints a brief description to a string.

Implements JointPolicyDiscretePure.

Reimplemented in JointPolicyPureVectorForClusteredBG.

References PartialJointPolicy::GetPastReward(), and JPolComponent_VectorImplementation::SoftPrintBrief().

Referenced by PrintBrief().

JPPV_sharedPtr PartialJointPolicyPureVector::ToJointPolicyPureVector ( ) const
virtual

Convert this joint policy to a JointPolicyPureVector.

Implements JointPolicyDiscretePure.

Reimplemented in JointPolicyPureVectorForClusteredBG.

virtual void PartialJointPolicyPureVector::ZeroInitialization ( )
inlinevirtual
virtual void PartialJointPolicyPureVector::ZeroInitialization ( Index  i)
inlinevirtual