MultiAgentDecisionProcess
JointPolicyPureVectorForClusteredBG Class Reference

JointPolicyPureVectorForClusteredBG represents a joint policy for a clustered CBG. More...

#include <JointPolicyPureVectorForClusteredBG.h>

Inheritance diagram for JointPolicyPureVectorForClusteredBG:
[legend]

Public Member Functions

virtual
JointPolicyPureVectorForClusteredBG
Clone () const
 Returns a pointer to a copy of this class. More...
 
boost::shared_ptr< const
BayesianGameWithClusterInfo
GetBG () const
 
JPPVfCBG_constPtr GetPrevJPPVfCBG () const
 
 JointPolicyPureVectorForClusteredBG (const boost::shared_ptr< const BayesianGameIdenticalPayoffInterface > &pu, PolicyGlobals::PolicyDomainCategory idc=TYPE_INDEX, JPPVfCBG_constPtr prevJPolBG=JPPVfCBG_constPtr(), double pastReward=0.0)
 (default) Constructor More...
 
 JointPolicyPureVectorForClusteredBG (const JointPolicyPureVectorForClusteredBG &a)
 Copy constructor. More...
 
virtual
JointPolicyPureVectorForClusteredBG
operator= (const JointPolicyPureVectorForClusteredBG &o)
 Copy assignment operator. More...
 
virtual
JointPolicyPureVectorForClusteredBG
operator= (const PartialJointPolicyPureVector &o)
 Copy assignment operator. More...
 
virtual
JointPolicyPureVectorForClusteredBG
operator= (const PartialJointPolicyDiscretePure &o)
 Copy assignment operator. More...
 
virtual
JointPolicyPureVectorForClusteredBG
operator= (const JointPolicyDiscretePure &o)
 Copy assignment operator. More...
 
virtual
JointPolicyPureVectorForClusteredBG
operator= (const JointPolicyDiscrete &o)
 Assignment operator. More...
 
virtual
JointPolicyPureVectorForClusteredBG
operator= (const JointPolicy &o)
 copy assignment operator More...
 
void SetPrevJPPVfCBG (JPPVfCBG_constPtr prevJpol)
 
std::string SoftPrint () const
 Prints a description of this JointPolicyPureVector to a string. More...
 
std::string SoftPrintBrief () const
 Prints a brief description to a string. More...
 
JPPV_sharedPtr ToJointPolicyPureVector () const
 Convert this joint policy to a JointPolicyPureVector. More...
 
virtual ~JointPolicyPureVectorForClusteredBG ()
 Destructor. More...
 
- Public Member Functions inherited from PartialJointPolicyPureVector
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
 
 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 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...
 
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...
 
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 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)
 

Private Member Functions

void RecursivelyFillPolicyForAgent (const PlanningUnitDecPOMDPDiscrete *pu, JPPV_sharedPtr jpolJPPV, Index agI, Index ts, Index aohI, Index ohI, const TypeCluster *tc, Index tI, Index aI, const std::vector< const JointPolicyDiscretePure * > &jpolBGVec, const std::vector< boost::shared_ptr< const BayesianGameWithClusterInfo > > &bgVec) const
 
void RecursivelyPrintPolicyForAgent (const PlanningUnitDecPOMDPDiscrete *pu, std::stringstream &ss, Index agI, Index ts, Index last_ts, Index aohI, Index ohI, const TypeCluster *tc, Index tI, Index aI, const std::vector< const JointPolicyDiscretePure * > &jpolBGVec, std::vector< boost::shared_ptr< const BayesianGameWithClusterInfo > > bgVec) const
 
void StartRecursiveConstructionPerAgent (const PlanningUnitDecPOMDPDiscrete *pu, JPPV_sharedPtr jpolJPPV, Index ts, const std::vector< const JointPolicyDiscretePure * > &jpolBGVec, const std::vector< boost::shared_ptr< const BayesianGameWithClusterInfo > > &bgVec) const
 
void StartRecursiveSoftPrintPerAgent (const PlanningUnitDecPOMDPDiscrete *pu, std::stringstream &ss, Index ts, Index last_ts, const std::vector< const JointPolicyDiscretePure * > &jpolBGVec, std::vector< boost::shared_ptr< const BayesianGameWithClusterInfo > > bgVec) const
 

Private Attributes

boost::shared_ptr< const
BayesianGameWithClusterInfo
_m_bg
 
JPPVfCBG_constPtr _m_prevJPolBG
 Stores a pointer to the previous policy for a clustered BG. More...
 

Additional Inherited Members

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

Detailed Description

JointPolicyPureVectorForClusteredBG represents a joint policy for a clustered CBG.

Constructor & Destructor Documentation

JointPolicyPureVectorForClusteredBG::JointPolicyPureVectorForClusteredBG ( const boost::shared_ptr< const BayesianGameIdenticalPayoffInterface > &  pu,
PolicyGlobals::PolicyDomainCategory  idc = TYPE_INDEX,
JPPVfCBG_constPtr  prevJPolBG = JPPVfCBG_constPtr(),
double  pastReward = 0.0 
)

(default) Constructor

References _m_bg, and PolicyGlobals::TYPE_INDEX.

Referenced by Clone().

JointPolicyPureVectorForClusteredBG::JointPolicyPureVectorForClusteredBG ( const JointPolicyPureVectorForClusteredBG a)

Copy constructor.

JointPolicyPureVectorForClusteredBG::~JointPolicyPureVectorForClusteredBG ( )
virtual

Destructor.

Member Function Documentation

JointPolicyPureVectorForClusteredBG * JointPolicyPureVectorForClusteredBG::Clone ( ) const
virtual

Returns a pointer to a copy of this class.

Reimplemented from PartialJointPolicyPureVector.

References JointPolicyPureVectorForClusteredBG().

JPPVfCBG_constPtr JointPolicyPureVectorForClusteredBG::GetPrevJPPVfCBG ( ) const
inline
JointPolicyPureVectorForClusteredBG & JointPolicyPureVectorForClusteredBG::operator= ( const JointPolicyPureVectorForClusteredBG o)
virtual

Copy assignment operator.

References _m_bg, _m_prevJPolBG, and PartialJointPolicyPureVector::operator=().

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

Copy assignment operator.

Reimplemented from PartialJointPolicyPureVector.

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

Copy assignment operator.

Reimplemented from PartialJointPolicyPureVector.

JointPolicyPureVectorForClusteredBG & JointPolicyPureVectorForClusteredBG::operator= ( const JointPolicyDiscretePure o)
virtual

Copy assignment operator.

Reimplemented from JointPolicyDiscretePure.

JointPolicyPureVectorForClusteredBG & JointPolicyPureVectorForClusteredBG::operator= ( const JointPolicyDiscrete o)
virtual

Assignment operator.

Reimplemented from JointPolicyDiscrete.

JointPolicyPureVectorForClusteredBG & JointPolicyPureVectorForClusteredBG::operator= ( const JointPolicy o)
virtual

copy assignment operator

Reimplemented from JointPolicy.

void JointPolicyPureVectorForClusteredBG::RecursivelyFillPolicyForAgent ( const PlanningUnitDecPOMDPDiscrete pu,
JPPV_sharedPtr  jpolJPPV,
Index  agI,
Index  ts,
Index  aohI,
Index  ohI,
const TypeCluster tc,
Index  tI,
Index  aI,
const std::vector< const JointPolicyDiscretePure * > &  jpolBGVec,
const std::vector< boost::shared_ptr< const BayesianGameWithClusterInfo > > &  bgVec 
) const
private
void JointPolicyPureVectorForClusteredBG::RecursivelyPrintPolicyForAgent ( const PlanningUnitDecPOMDPDiscrete pu,
std::stringstream &  ss,
Index  agI,
Index  ts,
Index  last_ts,
Index  aohI,
Index  ohI,
const TypeCluster tc,
Index  tI,
Index  aI,
const std::vector< const JointPolicyDiscretePure * > &  jpolBGVec,
std::vector< boost::shared_ptr< const BayesianGameWithClusterInfo > >  bgVec 
) const
private
void JointPolicyPureVectorForClusteredBG::SetPrevJPPVfCBG ( JPPVfCBG_constPtr  prevJpol)
inline
string JointPolicyPureVectorForClusteredBG::SoftPrint ( void  ) const
virtual
string JointPolicyPureVectorForClusteredBG::SoftPrintBrief ( void  ) const
virtual
JPPV_sharedPtr JointPolicyPureVectorForClusteredBG::ToJointPolicyPureVector ( ) const
virtual

Member Data Documentation

boost::shared_ptr<const BayesianGameWithClusterInfo> JointPolicyPureVectorForClusteredBG::_m_bg
private
JPPVfCBG_constPtr JointPolicyPureVectorForClusteredBG::_m_prevJPolBG
private

Stores a pointer to the previous policy for a clustered BG.

IFF the previous policy also is a JointPolicyPureVectorForClusteredBG if not (the previous policy was a regular past policy, e.g., a JointPolicyPureVector), then this variable is 0

Referenced by GetPrevJPPVfCBG(), operator=(), SoftPrintBrief(), and ToJointPolicyPureVector().