23 #ifndef BcpsObjectPool_h_
24 #define BcpsObjectPool_h_
54 for (
int i = static_cast<int> (
objects_.size() - 1); i > -1; --i) {
70 return static_cast<int>(
objects_.size());
75 return std::make_pair(
objects_[0], 0.0);
80 {
return objects_.empty() ?
false :
true; }
84 assert(k > -1 && k < ((
int)
objects_.size()));
87 std::vector<AlpsKnowledge *>::iterator pos;
150 #endif // End of file
int getNumConstraints() const
Query how many constraints are in the pool.
BcpsObjectPool()
Default construct.
void deleteConstraint(int k)
Delete constraint k from pool.
void freeGuts()
Free object pointers.
void deleteObject(int k)
Delete object k from pool.
virtual bool hasKnowledge() const
Check whether the pool has knowledge.
virtual std::pair< AlpsKnowledge *, double > getKnowledge() const
Query a knowledge, but doesn't remove it from the pool.
const std::vector< AlpsKnowledge * > & getVariables() const
Get the vector of variables.
virtual ~BcpsConstraintPool()
AlpsKnowledge * getObject(int k) const
Get a object.
const std::vector< AlpsKnowledge * > & getObjects() const
Get all objects.
int getNumVariables() const
Query how many variables are in the pool.
Object pool is used to store objects.
virtual ~BcpsObjectPool()
const std::vector< AlpsKnowledge * > & getConstraints() const
Get the vector of constraints.
virtual ~BcpsVariablePool()
AlpsKnowledge * getConstraint(int k) const
Get a constraints.
AlpsKnowledge * getVariable(int k) const
Get the vector of variables.
void clear()
Reset to empty.
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
void addVariable(BcpsVariable *var)
Add a variable to pool.
std::vector< AlpsKnowledge * > objects_
void deleteVariable(int k)
Delete variable k from pool.
void addConstraint(BcpsConstraint *con)
Add a constraint to pool.
virtual int getNumKnowledges() const
Query how many knowledges are in the pool.
virtual void addKnowledge(AlpsKnowledge *nk, double priority)
Add a knowledge to pool.