Object pool is used to store objects. More...
#include <BcpsObjectPool.h>
Public Member Functions | |
BcpsObjectPool () | |
Default construct. More... | |
virtual | ~BcpsObjectPool () |
void | freeGuts () |
Free object pointers. More... | |
void | clear () |
Reset to empty. More... | |
virtual void | addKnowledge (AlpsKnowledge *nk, double priority) |
Add a knowledge to pool. More... | |
virtual int | getNumKnowledges () const |
Query how many knowledges are in the pool. More... | |
virtual std::pair < AlpsKnowledge *, double > | getKnowledge () const |
Query a knowledge, but doesn't remove it from the pool. More... | |
virtual bool | hasKnowledge () const |
Check whether the pool has knowledge. More... | |
void | deleteObject (int k) |
Delete object k from pool. More... | |
const std::vector < AlpsKnowledge * > & | getObjects () const |
Get all objects. More... | |
AlpsKnowledge * | getObject (int k) const |
Get a object. More... | |
![]() | |
AlpsKnowledgePool () | |
virtual | ~AlpsKnowledgePool () |
virtual void | popKnowledge () |
Remove the queried knowledge from the pool. More... | |
virtual void | setMaxNumKnowledges (int num) |
Set the quantity limit of knowledges that can be stored in the pool. More... | |
virtual int | getMaxNumKnowledges () const |
Query the quantity limit of knowledges. More... | |
virtual std::pair < AlpsKnowledge *, double > | getBestKnowledge () const |
Query the best knowledge in the pool. More... | |
virtual void | getAllKnowledges (std::vector< std::pair< AlpsKnowledge *, double > > &kls) const |
Get a reference to all the knowledges in the pool. More... | |
Protected Attributes | |
std::vector< AlpsKnowledge * > | objects_ |
Object pool is used to store objects.
Definition at line 36 of file BcpsObjectPool.h.
|
inline |
Default construct.
Definition at line 45 of file BcpsObjectPool.h.
|
inlinevirtual |
Definition at line 46 of file BcpsObjectPool.h.
|
inline |
Free object pointers.
Definition at line 53 of file BcpsObjectPool.h.
|
inline |
|
inlinevirtual |
Add a knowledge to pool.
Implements AlpsKnowledgePool.
Definition at line 64 of file BcpsObjectPool.h.
|
inlinevirtual |
Query how many knowledges are in the pool.
Implements AlpsKnowledgePool.
Definition at line 69 of file BcpsObjectPool.h.
|
inlinevirtual |
Query a knowledge, but doesn't remove it from the pool.
Implements AlpsKnowledgePool.
Definition at line 74 of file BcpsObjectPool.h.
|
inlinevirtual |
Check whether the pool has knowledge.
Reimplemented from AlpsKnowledgePool.
Definition at line 79 of file BcpsObjectPool.h.
|
inline |
Delete object k from pool.
Definition at line 83 of file BcpsObjectPool.h.
|
inline |
Get all objects.
Definition at line 96 of file BcpsObjectPool.h.
|
inline |
Get a object.
Definition at line 99 of file BcpsObjectPool.h.
|
protected |
Definition at line 40 of file BcpsObjectPool.h.