MultiAgentDecisionProcess
|
JointPolicyPureVector represents a discrete pure joint policy. More...
#include <JointPolicyPureVector.h>
Public Member Functions | |
virtual JointPolicyPureVector * | Clone () const |
Returns a pointer to a copy of this class. More... | |
Index | GetActionIndex (Index agI, 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... | |
PolicyDiscrete * | GetIndividualPolicyDiscrete (Index i) 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) |
bool | Increment () |
JointPolicyPureVector (const Interface_ProblemToPolicyDiscretePure *pu) | |
Constructor. More... | |
JointPolicyPureVector (const Interface_ProblemToPolicyDiscretePure *pu, PolicyGlobals::PolicyDomainCategory idc) | |
Constructor. More... | |
JointPolicyPureVector (I_PtPDpure_constPtr pu) | |
Constructor. More... | |
JointPolicyPureVector (I_PtPDpure_constPtr pu, PolicyGlobals::PolicyDomainCategory idc) | |
Constructor. More... | |
JointPolicyPureVector (const JointPolicyPureVector &a) | |
Copy constructor. More... | |
JointPolicyPureVector (const JointPolicyDiscretePure &a1, const JPolComponent_VectorImplementation &a2) | |
Copy constructor from base class a. More... | |
bool | operator++ () |
Performs increment. See Increment(). More... | |
bool | operator< (const JointPolicy &o) const |
less-than operator. More... | |
bool | operator< (const JointPolicyPureVector &o) const |
JointPolicyPureVector & | operator= (const JointPolicyPureVector &jp) |
The copy assignment operator - makes deep copies using PolicyPureVector::operator= which makes deep copies. More... | |
JointPolicyPureVector & | operator= (const JointPolicyDiscretePure &jp) |
The copy assignment operator - makes deep copies using PolicyPureVector::operator= which makes deep copies. More... | |
void | PrintBrief () const |
void | RandomInitialization () |
Randomly initialize the joint policy. More... | |
void | RandomInitialization (Index i) |
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 | SetDepth (size_t d) |
Sets the depth of the joint policy. More... | |
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 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... | |
void | ZeroInitialization () |
Initialize the joint policy to the first joint policy. More... | |
void | ZeroInitialization (Index i) |
Initialize the policy of agentI to the first policy. More... | |
virtual | ~JointPolicyPureVector () |
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... | |
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... | |
Protected Attributes | |
std::vector< PolicyPureVector * > | _m_indivPols_PolicyPureVector |
Protected Attributes inherited from JointPolicy | |
size_t | _m_nrAgents |
some other numbers we cache: More... | |
Private Member Functions | |
void | ClearIndividualPolicies () |
Private function that deletes all the individual policies pointed to. 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... | |
Additional Inherited Members | |
Private Attributes inherited from JPolComponent_VectorImplementation | |
std::vector< PolicyPureVector * > | _m_indivPols_PolicyPureVector |
JointPolicyPureVector represents a discrete pure joint policy.
Each of the individual policies is a PolicyPureVector - a deterministic mapping from observations to actions implemented by a tree. This class acts as a wrapper. It contains a vector with pointers to indiv. policies.
we delete the PolicyPureVectors pointed to: this means that we should not be able to add indiv. policies without copying them!!!
|
inline |
Constructor.
Associates a problem (typically a planning unit) with the joint policy. Information regarding the problem is used to construct a joint policy of the proper shape.
Use the default PolicyDomainCategory defined by pu.
Referenced by Clone().
|
inline |
Constructor.
Associates a problem (typically a planning unit) with the joint policy. Information regarding the problem is used to construct a joint policy of the proper shape.
idc is the PolicyDomainCategory over which the policy is specified.
|
inline |
Constructor.
Associates a problem (typically a planning unit) with the joint policy. Information regarding the problem is used to construct a joint policy of the proper shape.
Use the default PolicyDomainCategory defined by pu.
|
inline |
Constructor.
Associates a problem (typically a planning unit) with the joint policy. Information regarding the problem is used to construct a joint policy of the proper shape.
idc is the PolicyDomainCategory over which the policy is specified.
|
inline |
Copy constructor.
|
inline |
Copy constructor from base class a.
|
inlinevirtual |
Destructor.
|
private |
Private function that deletes all the individual policies pointed to.
|
inlinevirtual |
Returns a pointer to a copy of this class.
Implements JointPolicyDiscretePure.
References JointPolicyPureVector().
Returns the action index for domainI for agent aI.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::GetActionIndex().
Referenced by AgentBG::Act(), JESPDynamicProgrammingPlanner::DPBestResponseRecursively(), and IndividualBeliefJESP::Update().
|
inline |
Get the index of this joint policy.
References JPolComponent_VectorImplementation::GetIndex().
Referenced by BGIPSolution::AddSolution(), AlphaVectorBG::BeliefBackupBGIP_Solver(), JPPVIndexValuePair::JPPVIndexValuePair(), and operator<().
|
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().
Referenced by BG_FactorGraphCreator::Construct_LocalPayoff_Factors().
|
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 AgentBG::Act(), AlphaVectorBG::BeliefBackupBGIP_Solver(), AlphaVectorBG::BeliefBackupExhaustiveOnlyKeepMax(), AlphaVectorBG::BeliefBackupExhaustiveStoreAll(), BG_FactorGraphCreator::Construct_LocalPayoff_Factors(), GMAA_MAAstarClassic::ConstructAndValuateNextPolicies(), and BayesianGameIdenticalPayoffSolver::Evaluate().
Returns the jaI taken by this policy for joint domain index johI.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::GetJointActionIndex().
|
inline |
|
inline |
References JPolComponent_VectorImplementation::Increment().
Referenced by operator++().
|
inline |
Performs increment. See Increment().
References Increment().
|
inlinevirtual |
less-than operator.
In many cases, it will be necessary to order Joint Policies)
Implements JointPolicy.
|
inline |
References GetIndex().
JointPolicyPureVector & JointPolicyPureVector::operator= | ( | const JointPolicyPureVector & | jp | ) |
The copy assignment operator - makes deep copies using PolicyPureVector::operator= which makes deep copies.
References JointPolicyDiscretePure::operator=(), and JPolComponent_VectorImplementation::operator=().
|
virtual |
The copy assignment operator - makes deep copies using PolicyPureVector::operator= which makes deep copies.
Reimplemented from JointPolicyDiscretePure.
|
inline |
References SoftPrintBrief().
|
inlinevirtual |
Randomly initialize the joint policy.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::RandomInitialization().
Referenced by JESPExhaustivePlanner::Plan(), JESPDynamicProgrammingPlanner::Plan(), and BGCG_SolverRandom::Solve().
|
inlinevirtual |
Randomly initialize the policy for agentI.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::RandomInitialization().
Sets the policy for agentI to domainI->aI.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::SetAction().
Referenced by JESPDynamicProgrammingPlanner::ConstructPolicyRecursively().
|
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 JPPVIndexValuePair::AllocateJPPV().
|
inline |
Sets the index of this joint policy.Updates the policies represented.
References JPolComponent_VectorImplementation::SetIndex().
Referenced by AgentBG::Act(), BGIPSolution::AddSolution(), and JPPVIndexValuePair::AllocateJPPV().
|
virtual |
Prints a description of this JointPolicyPureVector to a string.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::SoftPrint().
|
virtual |
Prints a brief description to a string.
Implements JointPolicyDiscretePure.
References JPolComponent_VectorImplementation::SoftPrintBrief().
Referenced by PrintBrief().
|
virtual |
Convert this joint policy to a JointPolicyPureVector.
Implements JointPolicyDiscretePure.
|
inline |
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 JPolComponent_VectorImplementation::ZeroInitialization().
Referenced by JESPExhaustivePlanner::ExhaustiveBestResponse().
|
inline |
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 JPolComponent_VectorImplementation::ZeroInitialization().
|
protected |