MultiAgentDecisionProcess
Release 0.2.1
|
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. | |
virtual Index | GetActionIndex (Index agI, Index domainI) const |
LIndex | GetIndex () const |
std::vector< PolicyPureVector * > & | GetIndividualPolicies () |
Returns a reference to the vector of pointers to individual policies. | |
virtual PolicyDiscrete * | GetIndividualPolicyDiscrete (Index i) const |
virtual Index | GetJointActionIndex (Index i) const |
bool | Increment (Index agentI) |
bool | Increment () |
bool | operator++ () |
virtual PartialJointPolicyPureVector & | operator= (const PartialJointPolicyPureVector &o) |
Copy assignment operator. | |
virtual PartialJointPolicyPureVector & | operator= (const PartialJointPolicyDiscretePure &o) |
PartialJointPolicyPureVector (const Interface_ProblemToPolicyDiscretePure &pu, PolicyGlobals::IndexDomainCategory idc, double pastReward=0.0, size_t depth=MAXHORIZON) | |
PartialJointPolicyPureVector (const PartialJointPolicyPureVector &a) | |
Copy constructor. | |
PartialJointPolicyPureVector (const PartialJointPolicyDiscretePure &a) | |
void | PrintBrief () const |
virtual void | RandomInitialization () |
virtual void | RandomInitialization (Index i) |
virtual void | SetAction (Index agentI, Index domainI, Index aI) |
void | SetDepth (size_t d) |
Sets the depth of the joint policy. | |
void | SetIndex (LIndex i) |
virtual std::string | SoftPrint () const |
Prints a description of this JointPolicyPureVector to a string. | |
virtual std::string | SoftPrintBrief () const |
Prints a brief description to a string. | |
JointPolicyPureVector * | ToJointPolicyPureVector () const |
Convert this joint policy to a JointPolicyPureVector. | |
virtual void | ZeroInitialization () |
virtual void | ZeroInitialization (Index i) |
virtual | ~PartialJointPolicyPureVector () |
Destructor. | |
![]() | |
virtual PartialJointPolicyDiscretePure & | operator= (const PartialJointPolicyDiscretePure &o) |
Destructor. | |
PartialJointPolicyDiscretePure () | |
(default) Constructor | |
PartialJointPolicyDiscretePure (const Interface_ProblemToPolicyDiscretePure &pu, PolicyGlobals::IndexDomainCategory idc, double pastReward=0.0) | |
PartialJointPolicyDiscretePure (const PartialJointPolicyDiscretePure &a) | |
Copy constructor. | |
![]() | |
virtual JointPolicyDiscretePure * | Clone () const =0 |
Returns a pointer to a copy of this class. | |
virtual Index | GetActionIndex (Index aI, Index domainI) const =0 |
Returns the action index for domainI for agent aI. | |
double | GetActionProb (Index agentI, Index domI, Index aI) const |
Returns the probability that the policy specifies action aI for domain index domI for agentI. | |
const Interface_ProblemToPolicyDiscretePure * | GetInterfacePTPDiscretePure () const |
Return pointer to the Interface_ProblemToPolicyDiscretePure. | |
virtual Index | GetJointActionIndex (Index i) const =0 |
Returns the jaI taken by this policy for joint domain index johI. | |
double | GetJointActionProb (Index i, Index ja) const |
Returns the probability that the policy specifies joint action a for domain index i. | |
JointPolicyDiscretePure () | |
default Constructor - constructs empty policy | |
JointPolicyDiscretePure (const Interface_ProblemToPolicyDiscretePure &pu, PolicyGlobals::IndexDomainCategory idc) | |
(default) Constructor | |
JointPolicyDiscretePure (const JointPolicyDiscretePure &a) | |
Copy constructor. | |
virtual JointPolicyDiscretePure & | operator= (const JointPolicyDiscretePure &o) |
Copy assignment operator. | |
virtual void | RandomInitialization ()=0 |
Randomly initialize the joint policy. | |
virtual void | RandomInitialization (Index agentI)=0 |
Randomly initialize the policy for agentI. | |
virtual void | SetAction (Index agentI, Index domainI, Index aI)=0 |
Sets the policy for agentI to domainI->aI. | |
void | SetInterfacePTPDiscretePure (Interface_ProblemToPolicyDiscretePure *pu) |
Sets the planning unit for this joint policy. | |
virtual std::string | SoftPrint () const =0 |
Prints a description of this JointPolicyPureVector to a string. | |
virtual std::string | SoftPrintBrief () const =0 |
Prints a brief description to a string. | |
virtual JointPolicyPureVector * | ToJointPolicyPureVector () const =0 |
virtual | ~JointPolicyDiscretePure () |
Destructor. | |
![]() | |
IndexDomainCategory | GetIndexDomainCategory () const |
returns the Category of the domain over which the indices of this policy are specified. | |
virtual PolicyDiscrete * | GetIndividualPolicyDiscrete (Index agI) const =0 |
return pointer to individual policy of agent agI | |
const Interface_ProblemToPolicyDiscrete * | GetInterfacePTPDiscrete () const |
return a pointer to the referred Interface_ProblemToPolicyDiscrete. | |
size_t | GetNrDomainElements (Index agentI) const |
Returns the number of policy domain elements for agent agentI. | |
JointPolicyDiscrete () | |
default constructor creates an empty policy | |
JointPolicyDiscrete (const Interface_ProblemToPolicyDiscrete &pu, PolicyGlobals::IndexDomainCategory idc) | |
(default) Constructor | |
JointPolicyDiscrete (const JointPolicyDiscrete &a) | |
Copy constructor. | |
virtual JointPolicyDiscrete & | operator= (const JointPolicyDiscrete &o) |
Assignment operator. | |
Index | SampleJointAction (Index i) const |
Returns a sampled joint action. | |
Index | SampleJointAction (const std::vector< Index > &Is) const |
Returns a sampled joint action. | |
void | SampleJointActionVector (Index i, std::vector< Index > &jaVec) const |
Returns a sampled joint action. | |
void | SampleJointActionVector (const std::vector< Index > &Is, std::vector< Index > &jaVec) const |
Returns a sampled joint action. | |
void | SetIndexDomainCategory (IndexDomainCategory idc) |
sets the category of the domain over which the indices of this policy are specified. | |
void | SetInterfacePTPDiscrete (const Interface_ProblemToPolicyDiscrete *p) |
sets the pointer to the Interface_ProblemToPolicyDiscrete. | |
virtual | ~JointPolicyDiscrete () |
Destructor. | |
![]() | |
size_t | GetDepth () const |
Returns the depth of the joint policy. | |
size_t | GetNrAgents () const |
Returns the number of agents for which the joint policy is defined. | |
JointPolicy (size_t nrAg) | |
Constructor, initializes the depth to the maximum horizon. | |
JointPolicy (const JointPolicy &o) | |
copy constructor: | |
virtual JointPolicy & | operator= (const JointPolicy &o) |
copy assignment operator | |
virtual void | Print () const |
Prints a description of a joint policy to cout. | |
virtual void | SetDepth (size_t d) |
Sets the depth of the joint policy. | |
virtual | ~JointPolicy () |
Destructor. | |
![]() | |
double | GetPastReward () const |
PartialJointPolicy & | operator= (const PartialJointPolicy &o) |
Destructor. | |
PartialJointPolicy (double r=0.0) | |
(default) Constructor | |
PartialJointPolicy (const PartialJointPolicy &a) | |
Copy constructor. | |
void | SetPastReward (double r) |
Additional Inherited Members | |
![]() | |
size_t | _m_nrAgents |
some other numbers we cache: | |
![]() | |
Index | GetActionIndex (Index aI, Index domainI) const |
Returns the action index for domainI for agent aI. | |
LIndex | GetIndex () const |
Get the index of this joint policy. | |
std::vector< PolicyPureVector * > & | GetIndividualPolicies () |
Returns a reference to the vector of pointers to individual policies. | |
virtual PolicyDiscrete * | GetIndividualPolicyDiscrete (Index agI) const |
Index | GetJointActionIndex (Index i) const |
Returns the jaI taken by this policy for joint domain index johI. | |
bool | Increment (Index agentI) |
Increments the individual policy of agentI. | |
bool | Increment () |
Increments the joint policy, used to iterate over joint policies. | |
JPolComponent_VectorImplementation (const Interface_ProblemToPolicyDiscretePure &pu, size_t depth=MAXHORIZON) | |
(default) Constructor | |
JPolComponent_VectorImplementation (const Interface_ProblemToPolicyDiscretePure &pu, PolicyGlobals::IndexDomainCategory idc, size_t depth=MAXHORIZON) | |
JPolComponent_VectorImplementation (const JPolComponent_VectorImplementation &a) | |
Copy constructor. | |
bool | operator++ () |
Performs increment. See Increment(). | |
JPolComponent_VectorImplementation & | operator= (const JPolComponent_VectorImplementation &o) |
Copy assignment operator. | |
void | RandomInitialization () |
Randomly initialize the joint policy. | |
void | RandomInitialization (Index agentI) |
Randomly initialize the policy for agentI. | |
void | SetAction (Index agentI, Index domainI, Index aI) |
Sets the policy for agentI to domainI->aI. | |
void | SetDepthForIndivPols (size_t d) |
void | SetIndex (LIndex i) |
Sets the index of this joint policy.Updates the policies represented. | |
std::string | SoftPrint () const |
Prints a description of this to a string. | |
std::string | SoftPrintBrief () const |
void | ZeroInitialization () |
Initialize the joint policy to the first joint policy. | |
void | ZeroInitialization (Index agentI) |
Initialize the policy of agentI to the first policy. | |
~JPolComponent_VectorImplementation () | |
Destructor. |
PartialJointPolicyPureVector implements a PartialJointPolicy using a mapping of history indices to actions.
Definition at line 40 of file PartialJointPolicyPureVector.h.
PartialJointPolicyPureVector::PartialJointPolicyPureVector | ( | const Interface_ProblemToPolicyDiscretePure & | pu, |
PolicyGlobals::IndexDomainCategory | idc, | ||
double | pastReward = 0.0 , |
||
size_t | depth = MAXHORIZON |
||
) |
Definition at line 33 of file PartialJointPolicyPureVector.cpp.
References SetDepth().
Referenced by Clone().
|
inline |
Copy constructor.
Definition at line 58 of file PartialJointPolicyPureVector.h.
|
inline |
Definition at line 63 of file PartialJointPolicyPureVector.h.
|
inlinevirtual |
Destructor.
Definition at line 72 of file PartialJointPolicyPureVector.h.
|
inlinevirtual |
Returns a pointer to a copy of this class.
Definition at line 137 of file PartialJointPolicyPureVector.h.
References PartialJointPolicyPureVector().
|
inlinevirtual |
Definition at line 114 of file PartialJointPolicyPureVector.h.
|
inline |
Definition at line 107 of file PartialJointPolicyPureVector.h.
Referenced by PartialJPPVIndexValuePair::PartialJPPVIndexValuePair().
|
inline |
Returns a reference to the vector of pointers to individual policies.
This function should be used to manipulate individual policies.
Definition at line 122 of file PartialJointPolicyPureVector.h.
|
inlinevirtual |
Definition at line 117 of file PartialJointPolicyPureVector.h.
|
inlinevirtual |
Definition at line 112 of file PartialJointPolicyPureVector.h.
|
inline |
Definition at line 102 of file PartialJointPolicyPureVector.h.
References Increment().
|
inline |
Definition at line 104 of file PartialJointPolicyPureVector.h.
Referenced by Increment(), and operator++().
|
inline |
Definition at line 100 of file PartialJointPolicyPureVector.h.
References Increment().
|
virtual |
Copy assignment operator.
Definition at line 45 of file PartialJointPolicyPureVector.cpp.
Referenced by operator=().
|
virtual |
Definition at line 53 of file PartialJointPolicyPureVector.cpp.
References operator=().
|
inline |
Definition at line 91 of file PartialJointPolicyPureVector.h.
References SoftPrintBrief().
|
inlinevirtual |
Definition at line 129 of file PartialJointPolicyPureVector.h.
Referenced by RandomInitialization().
|
inlinevirtual |
Definition at line 131 of file PartialJointPolicyPureVector.h.
References RandomInitialization().
|
inlinevirtual |
Definition at line 133 of file PartialJointPolicyPureVector.h.
|
inline |
Sets the depth of the joint policy.
Also sets the depth of each of the invididual policies.
Definition at line 81 of file PartialJointPolicyPureVector.h.
References JPolComponent_VectorImplementation::SetDepthForIndivPols().
Referenced by PolicyPoolPartialJPolValPair::Init(), and PartialJointPolicyPureVector().
|
inline |
Definition at line 109 of file PartialJointPolicyPureVector.h.
Referenced by PartialJPPVIndexValuePair::AllocateJPPV().
|
virtual |
Prints a description of this JointPolicyPureVector to a string.
Definition at line 64 of file PartialJointPolicyPureVector.cpp.
References PartialJointPolicy::GetPastReward().
|
virtual |
Prints a brief description to a string.
Definition at line 72 of file PartialJointPolicyPureVector.cpp.
References PartialJointPolicy::GetPastReward().
Referenced by PrintBrief().
JointPolicyPureVector * PartialJointPolicyPureVector::ToJointPolicyPureVector | ( | ) | const |
Convert this joint policy to a JointPolicyPureVector.
Definition at line 80 of file PartialJointPolicyPureVector.cpp.
|
inlinevirtual |
Definition at line 125 of file PartialJointPolicyPureVector.h.
Referenced by ZeroInitialization().
|
inlinevirtual |
Definition at line 127 of file PartialJointPolicyPureVector.h.
References ZeroInitialization().