MultiAgentDecisionProcess  Release 0.2.1
PolicyPoolPartialJPolValPair Class Reference

PolicyPoolJPolValPair is a policy pool with partial joint policy - value pairs. More...

#include <PolicyPoolPartialJPolValPair.h>

+ Inheritance diagram for PolicyPoolPartialJPolValPair:
+ Collaboration diagram for PolicyPoolPartialJPolValPair:

Public Member Functions

PartialPolicyPoolItemInterfaceGetBestRanked () 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 (PartialPolicyPoolItemInterface *ppi)
 Add a PolicyPoolItem to the Pool.
PolicyPoolPartialJPolValPairoperator= (const PolicyPoolPartialJPolValPair &o)
 Copy assignment operator.
PartialPolicyPoolInterfaceoperator= (const PartialPolicyPoolInterface &o)
 Copy assignment operator.
 PolicyPoolPartialJPolValPair ()
 (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
PartialPolicyPoolItemInterfaceSelect () const
 The 'Select' operator from refGMAA.
size_t Size () const
 return the number of items in the policy pool
void Union (PartialPolicyPoolInterface *pp)
 add all elements of pp to 'this'.
 ~PolicyPoolPartialJPolValPair ()
 Copy constructor.
- Public Member Functions inherited from PartialPolicyPoolInterface
size_t Empty () const
 return whether the number of items in the policy pool is 0
virtual ~PartialPolicyPoolInterface ()
 (default) Constructor

Private Attributes

std::priority_queue
< PartialJPDPValuePair * > * 
_m_jpvpQueue_p
 The pointer to the PartialJPDPValuePair queue.

Detailed Description

PolicyPoolJPolValPair is a policy pool with partial joint policy - value pairs.

Definition at line 43 of file PolicyPoolPartialJPolValPair.h.

Constructor & Destructor Documentation

PolicyPoolPartialJPolValPair::PolicyPoolPartialJPolValPair ( )

(default) Constructor

Definition at line 35 of file PolicyPoolPartialJPolValPair.cpp.

PolicyPoolPartialJPolValPair::~PolicyPoolPartialJPolValPair ( )

Copy constructor.

Destructor.

Definition at line 47 of file PolicyPoolPartialJPolValPair.cpp.

Member Function Documentation

PartialPolicyPoolItemInterface* PolicyPoolPartialJPolValPair::GetBestRanked ( ) const
inlinevirtual

returns the contained item with the highest value.

This function returns a pointer to the PartialPolicyPoolItemInterface 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 PartialPolicyPoolInterface.

Definition at line 101 of file PolicyPoolPartialJPolValPair.h.

References Select().

void PolicyPoolPartialJPolValPair::Init ( const Interface_ProblemToPolicyDiscretePure pu)
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 PartialPolicyPoolInterface.

Definition at line 92 of file PolicyPoolPartialJPolValPair.cpp.

References PolicyGlobals::OHIST_INDEX, and PartialJointPolicyPureVector::SetDepth().

void PolicyPoolPartialJPolValPair::Insert ( PartialPolicyPoolItemInterface ppi)
virtual

Add a PolicyPoolItem to the Pool.

...

Implements PartialPolicyPoolInterface.

Definition at line 128 of file PolicyPoolPartialJPolValPair.cpp.

PolicyPoolPartialJPolValPair & PolicyPoolPartialJPolValPair::operator= ( const PolicyPoolPartialJPolValPair o)

Copy assignment operator.

Definition at line 58 of file PolicyPoolPartialJPolValPair.cpp.

References DEBUG_PPJPVP_ASSIGN.

PartialPolicyPoolInterface & PolicyPoolPartialJPolValPair::operator= ( const PartialPolicyPoolInterface o)
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 PartialPolicyPoolInterface::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 PartialPolicyPoolInterface.

Definition at line 78 of file PolicyPoolPartialJPolValPair.cpp.

References DEBUG_PPJPVP_ASSIGN.

void PolicyPoolPartialJPolValPair::Pop ( )
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 PartialPolicyPoolInterface.

Definition at line 122 of file PolicyPoolPartialJPolValPair.cpp.

Referenced by PopBestRanked().

void PolicyPoolPartialJPolValPair::PopBestRanked ( )
inlinevirtual

remove the GetBestRanked() item

Removes the PartialPolicyPoolItemInterface 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 PartialPolicyPoolInterface.

Definition at line 112 of file PolicyPoolPartialJPolValPair.h.

References Pop().

void PolicyPoolPartialJPolValPair::Prune ( double  v)
virtual

prune the items in the policy pool with exp.value < v

...

Implements PartialPolicyPoolInterface.

Definition at line 153 of file PolicyPoolPartialJPolValPair.cpp.

References PartialJointPolicyValuePair::GetValue().

PartialPolicyPoolItemInterface * PolicyPoolPartialJPolValPair::Select ( ) const
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 PartialPolicyPoolInterface.

Definition at line 110 of file PolicyPoolPartialJPolValPair.cpp.

Referenced by GetBestRanked().

size_t PolicyPoolPartialJPolValPair::Size ( ) const
inlinevirtual

return the number of items in the policy pool

...

Implements PartialPolicyPoolInterface.

Definition at line 132 of file PolicyPoolPartialJPolValPair.h.

References _m_jpvpQueue_p.

void PolicyPoolPartialJPolValPair::Union ( PartialPolicyPoolInterface pp)
virtual

add all elements of pp to 'this'.

Note, that the pool pp is emptied in this process.

Implements PartialPolicyPoolInterface.

Definition at line 139 of file PolicyPoolPartialJPolValPair.cpp.

References _m_jpvpQueue_p.

Member Data Documentation

std::priority_queue<PartialJPDPValuePair*>* PolicyPoolPartialJPolValPair::_m_jpvpQueue_p
private

The pointer to the PartialJPDPValuePair queue.

Definition at line 47 of file PolicyPoolPartialJPolValPair.h.

Referenced by Size(), and Union().


The documentation for this class was generated from the following files: