MultiAgentDecisionProcess
JPolComponent_VectorImplementation Class Reference

JPolComponent_VectorImplementation implements functionality common to several joint policy implementations. More...

#include <JPolComponent_VectorImplementation.h>

Inheritance diagram for JPolComponent_VectorImplementation:
[legend]

Public Member Functions

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...
 
virtual PolicyDiscreteGetIndividualPolicyDiscrete (Index agI) const
 
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...
 

Protected Attributes

std::vector< PolicyPureVector * > _m_indivPols_PolicyPureVector
 

Private Member Functions

void ClearIndividualPolicies ()
 Private function that deletes all the individual policies pointed to. More...
 
void Construct (const Interface_ProblemToPolicyDiscretePure *pu, PolicyGlobals::PolicyDomainCategory idc, size_t depth)
 
void Construct (const I_PtPDpure_constPtr &pu, PolicyGlobals::PolicyDomainCategory idc, size_t depth)
 
const
Interface_ProblemToPolicyDiscretePure
GetInterfacePTPDiscretePure () const
 
void PrivClone (const JPolComponent_VectorImplementation &o)
 Aux. function used by copy constructors. More...
 

Private Attributes

PolicyDomainCategory _m_idc
 
Index_m_indivActionIndices
 vector for temporarily storing indiv. actions More...
 
const
Interface_ProblemToPolicyDiscretePure
_m_PTPDP
 
I_PtPDpure_constPtr _m_PTPDPshared
 

Detailed Description

JPolComponent_VectorImplementation implements functionality common to several joint policy implementations.

Constructor & Destructor Documentation

JPolComponent_VectorImplementation::JPolComponent_VectorImplementation ( const Interface_ProblemToPolicyDiscretePure pu,
size_t  depth = MAXHORIZON 
)
JPolComponent_VectorImplementation::JPolComponent_VectorImplementation ( const Interface_ProblemToPolicyDiscretePure pu,
PolicyGlobals::PolicyDomainCategory  idc,
size_t  depth = MAXHORIZON 
)

References Construct().

JPolComponent_VectorImplementation::JPolComponent_VectorImplementation ( const I_PtPDpure_constPtr pu,
size_t  depth = MAXHORIZON 
)

References Construct().

JPolComponent_VectorImplementation::JPolComponent_VectorImplementation ( const I_PtPDpure_constPtr pu,
PolicyGlobals::PolicyDomainCategory  idc,
size_t  depth = MAXHORIZON 
)

References Construct().

JPolComponent_VectorImplementation::JPolComponent_VectorImplementation ( const JPolComponent_VectorImplementation a)

Copy constructor.

References PrivClone().

JPolComponent_VectorImplementation::~JPolComponent_VectorImplementation ( )

Destructor.

References _m_indivActionIndices, and ClearIndividualPolicies().

Member Function Documentation

void JPolComponent_VectorImplementation::ClearIndividualPolicies ( )
private

Private function that deletes all the individual policies pointed to.

References _m_indivPols_PolicyPureVector.

Referenced by operator=(), and ~JPolComponent_VectorImplementation().

void JPolComponent_VectorImplementation::Construct ( const Interface_ProblemToPolicyDiscretePure pu,
PolicyGlobals::PolicyDomainCategory  idc,
size_t  depth 
)
private
void JPolComponent_VectorImplementation::Construct ( const I_PtPDpure_constPtr pu,
PolicyGlobals::PolicyDomainCategory  idc,
size_t  depth 
)
private

References Globals::MAXHORIZON.

Index JPolComponent_VectorImplementation::GetActionIndex ( Index  aI,
Index  domainI 
) const
inline

Returns the action index for domainI for agent aI.

Referenced by PartialJointPolicyPureVector::GetActionIndex(), JointPolicyPureVector::GetActionIndex(), and GetJointActionIndex().

std::vector<PolicyPureVector*>& JPolComponent_VectorImplementation::GetIndividualPolicies ( )
inline

Returns a reference to the vector of pointers to individual policies.

This function should be used to manipulate individual policies.

References _m_indivPols_PolicyPureVector.

Referenced by PartialJointPolicyPureVector::GetIndividualPolicies(), and JointPolicyPureVector::GetIndividualPolicies().

virtual PolicyDiscrete* JPolComponent_VectorImplementation::GetIndividualPolicyDiscrete ( Index  agI) const
inlinevirtual
const Interface_ProblemToPolicyDiscretePure* JPolComponent_VectorImplementation::GetInterfacePTPDiscretePure ( ) const
inlineprivate
Index JPolComponent_VectorImplementation::GetJointActionIndex ( LIndex  i) const

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

References Globals::CastLIndexToIndex(), and GetJointActionIndex().

bool JPolComponent_VectorImplementation::Increment ( Index  agentI)
inline

Increments the individual policy of agentI.

bool JPolComponent_VectorImplementation::Increment ( )
bool JPolComponent_VectorImplementation::operator++ ( )
inline

Performs increment. See Increment().

References Increment().

JPolComponent_VectorImplementation & JPolComponent_VectorImplementation::operator= ( const JPolComponent_VectorImplementation o)
void JPolComponent_VectorImplementation::PrivClone ( const JPolComponent_VectorImplementation o)
private
void JPolComponent_VectorImplementation::RandomInitialization ( )
void JPolComponent_VectorImplementation::RandomInitialization ( Index  agentI)

Randomly initialize the policy for agentI.

References _m_indivPols_PolicyPureVector, and PolicyPureVector::RandomInitialization().

void JPolComponent_VectorImplementation::SetAction ( Index  agentI,
Index  domainI,
Index  aI 
)
inline

Sets the policy for agentI to domainI->aI.

Referenced by PartialJointPolicyPureVector::SetAction(), and JointPolicyPureVector::SetAction().

void JPolComponent_VectorImplementation::SetDepthForIndivPols ( size_t  d)
string JPolComponent_VectorImplementation::SoftPrint ( void  ) const
string JPolComponent_VectorImplementation::SoftPrintBrief ( void  ) const
void JPolComponent_VectorImplementation::ZeroInitialization ( )

Initialize the joint policy to the first joint policy.

This is the joint policy that specifies action 0 –the first action– for all observation histories.

References _m_indivPols_PolicyPureVector.

Referenced by PartialJointPolicyPureVector::ZeroInitialization(), and JointPolicyPureVector::ZeroInitialization().

void JPolComponent_VectorImplementation::ZeroInitialization ( Index  agentI)

Initialize the policy of agentI to the first policy.

This is the policy that specifies action 0 –the first action– for all observation histories.

References _m_indivPols_PolicyPureVector, and PolicyPureVector::ZeroInitialization().

Member Data Documentation

PolicyDomainCategory JPolComponent_VectorImplementation::_m_idc
private
Index* JPolComponent_VectorImplementation::_m_indivActionIndices
private

vector for temporarily storing indiv. actions

(used by GetJointActionIndex)

Referenced by GetJointActionIndex(), PrivClone(), and ~JPolComponent_VectorImplementation().

const Interface_ProblemToPolicyDiscretePure* JPolComponent_VectorImplementation::_m_PTPDP
private

Referenced by PrivClone().

I_PtPDpure_constPtr JPolComponent_VectorImplementation::_m_PTPDPshared
private

Referenced by PrivClone().