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 BcpsObjectPool()
Default construct.
virtual ~BcpsConstraintPool()
virtual int getNumKnowledges() const
Query how many knowledges are in the pool.
int getNumVariables() const
Query how many variables are in the pool.
int getNumConstraints() const
Query how many constraints are in the pool.
virtual bool hasKnowledge() const
Check whether the pool has knowledge.
void deleteObject(int k)
Delete object k from pool.
virtual ~BcpsVariablePool()
virtual std::pair< AlpsKnowledge *, double > getKnowledge() const
Query a knowledge, but doesn't remove it from the pool.
virtual void addKnowledge(AlpsKnowledge *nk, double priority)
Add a knowledge to pool.
AlpsKnowledge * getObject(int k) const
Get a object.
virtual ~BcpsObjectPool()
const std::vector< AlpsKnowledge * > & getConstraints() const
Get the vector of constraints.
AlpsKnowledge * getConstraint(int k) const
Get a constraints.
Object pool is used to store objects.
const std::vector< AlpsKnowledge * > & getVariables() const
Get the vector of variables.
void clear()
Reset to empty.
void deleteConstraint(int k)
Delete constraint k from pool.
std::vector< AlpsKnowledge * > objects_
void addVariable(BcpsVariable *var)
Add a variable to pool.
void addConstraint(BcpsConstraint *con)
Add a constraint to pool.
void freeGuts()
Free object pointers.
void deleteVariable(int k)
Delete variable k from pool.
AlpsKnowledge * getVariable(int k) const
Get the vector of variables.
const std::vector< AlpsKnowledge * > & getObjects() const
Get all objects.