MultiAgentDecisionProcess
Release 0.2.1
|
PolicyPoolJPolValPair is a policy pool with joint policy - value pairs. More...
#include <PolicyPoolJPolValPair.h>
Public Member Functions | |
PolicyPoolItemInterface * | GetBestRanked () const |
returns the contained item with the highest value. | |
void | Init (const Interface_ProblemToPolicyDiscretePure *pu) |
initializes the policy pool with the empty joint policy and a heuristic value set to infinuty (i.e., DBL_MAX) | |
void | Insert (PolicyPoolItemInterface *ppi) |
Add a PolicyPoolItem to the Pool. | |
PolicyPoolJPolValPair & | operator= (const PolicyPoolJPolValPair &o) |
Copy assignment operator. | |
PolicyPoolInterface & | operator= (const PolicyPoolInterface &o) |
Copy assignment operator. | |
PolicyPoolJPolValPair () | |
(default) Constructor | |
void | Pop () |
Removes the item returned by 'Select'. | |
void | PopBestRanked () |
remove the GetBestRanked() item | |
void | Prune (double v) |
prune the items in the policy pool with exp.value < v | |
PolicyPoolItemInterface * | Select () const |
The 'Select' operator from refGMAA. | |
size_t | Size () const |
return the number of items in the policy pool | |
void | Union (PolicyPoolInterface *pp) |
add all elements of pp to 'this'. | |
~PolicyPoolJPolValPair () | |
Destructor. | |
![]() | |
size_t | Empty () const |
return whether the number of items in the policy pool is 0 | |
virtual | ~PolicyPoolInterface () |
(default) Constructor |
Private Attributes | |
std::priority_queue < JointPolicyValuePair * > * | _m_jpvpQueue_p |
The pointer to the JointPolicyValuePair queue. |
PolicyPoolJPolValPair is a policy pool with joint policy - value pairs.
Definition at line 42 of file PolicyPoolJPolValPair.h.
PolicyPoolJPolValPair::PolicyPoolJPolValPair | ( | ) |
(default) Constructor
Definition at line 36 of file PolicyPoolJPolValPair.cpp.
PolicyPoolJPolValPair::~PolicyPoolJPolValPair | ( | ) |
Destructor.
Definition at line 42 of file PolicyPoolJPolValPair.cpp.
|
inlinevirtual |
returns the contained item with the highest value.
This function returns a pointer to the PolicyPoolItemInterface contained in this Policy pool with the highest (heuristic) value.
Heuristic is between brackets, because this function is typically used when we found lower bounds (i.e. full policies) and then select the maximum lowerbound.
Because this class always 'select's the best ranked policy, this function does the same as 'Select()'.
Implements PolicyPoolInterface.
Definition at line 98 of file PolicyPoolJPolValPair.h.
References Select().
|
virtual |
initializes the policy pool with the empty joint policy and a heuristic value set to infinuty (i.e., DBL_MAX)
A pointer to a Interface_ProblemToPolicyDiscretePure is needed to create the joint policy.
Implements PolicyPoolInterface.
Definition at line 87 of file PolicyPoolJPolValPair.cpp.
References PolicyGlobals::OHIST_INDEX, and JointPolicyPureVector::SetDepth().
|
virtual |
Add a PolicyPoolItem to the Pool.
...
Implements PolicyPoolInterface.
Definition at line 116 of file PolicyPoolJPolValPair.cpp.
PolicyPoolJPolValPair & PolicyPoolJPolValPair::operator= | ( | const PolicyPoolJPolValPair & | o | ) |
Copy assignment operator.
Definition at line 53 of file PolicyPoolJPolValPair.cpp.
References DEBUG_PPJPVP_ASSIGN.
|
virtual |
Copy assignment operator.
This must be implemented by the derived class (with this prototype). For an example, see PolicyPoolJPolValPair.
For now, this function is purely abstract. Might there be some members added to this (base) class, then an implementation could be made. This should then be called using PolicyPoolInterface::operator=(o) from the copy assignment operator of the derived class. See also http://www.icu-project.org/docs/papers/cpp_report/the_assignment_operator_revisited.html.
Implements PolicyPoolInterface.
Definition at line 73 of file PolicyPoolJPolValPair.cpp.
References DEBUG_PPJPVP_ASSIGN.
|
virtual |
Removes the item returned by 'Select'.
This removes the next PolicyPoolItem (a wrapper for a partial joint policy, together with some properties), as would be returned by 'Select'.
Implements PolicyPoolInterface.
Definition at line 110 of file PolicyPoolJPolValPair.cpp.
Referenced by PopBestRanked().
|
inlinevirtual |
remove the GetBestRanked() item
Removes the PolicyPoolItemInterface contained in this Policy pool with the highest (heuristic) value. (as is returned by GetBestRanked() )
Because this class always 'select's the best ranked policy, this function does the same as 'Pop()'.
Implements PolicyPoolInterface.
Definition at line 109 of file PolicyPoolJPolValPair.h.
References Pop().
|
virtual |
prune the items in the policy pool with exp.value < v
...
Implements PolicyPoolInterface.
Definition at line 141 of file PolicyPoolJPolValPair.cpp.
References JointPolicyValuePair::GetValue().
|
virtual |
The 'Select' operator from refGMAA.
This returns a reference to the next PolicyPoolItem (a wrapper for a partial joint policy, together with some properties).
The returned PolicyPoolItem is not removed from the PolicyPool.
Implements PolicyPoolInterface.
Definition at line 98 of file PolicyPoolJPolValPair.cpp.
Referenced by GetBestRanked().
|
inlinevirtual |
return the number of items in the policy pool
...
Implements PolicyPoolInterface.
Definition at line 129 of file PolicyPoolJPolValPair.h.
References _m_jpvpQueue_p.
|
virtual |
add all elements of pp to 'this'.
Note, that the pool pp is emptied in this process.
Implements PolicyPoolInterface.
Definition at line 127 of file PolicyPoolJPolValPair.cpp.
References _m_jpvpQueue_p.
|
private |
The pointer to the JointPolicyValuePair queue.
Definition at line 46 of file PolicyPoolJPolValPair.h.