Class IloPack
Definition file: ilconcert/ilomodel.h

For constraint programming: maintains the load of containers, given
weighted, assigned items.
The IloPack
constraint maintains the load of a set of
containers or bins, given a set of weighted items and an assignment
of items to containers.
Consider that we have n items and
m containers. Each item i has an integer weight
w[i] and a constrained integer variable p[i]
associated with it, specifying in which container (numbered contiguously
from 0) item i is to be placed. No item can be split up,
and so an item can go in only one container. Associated with each
container j is an integer variable l[j] representing
the load in that container; that is, the sum of the weights of the
items which have been assigned to that container. A capacity can be
set for each container placing an upper bound on this load variable.
The constraint also ensures that the total sum of the loads of the
containers is equal to the sum of the weights of the items being placed.
Finally, the number, or indeed the set of containers used can be
specified. A container is used if at least one item is placed in the
container in question.
Constructor Summary |
---|
public | IloPack() |
public | IloPack(IloPackI * impl) |
public | IloPack(const IloEnv env, const IloIntExprArray load, const IloIntExprArray where, const IloIntArray weight, const char * name=0) |
public | IloPack(const IloEnv env, const IloIntExprArray load, const IloIntExprArray where, const IloIntArray weight, const IloIntExpr used, const char * name=0) |
public | IloPack(const IloEnv env, const IloIntExprArray load, const IloIntExprArray where, const IloIntArray weight, const IloIntSetVar used, const char * name=0) |
Method Summary |
---|
public IloPackI * | getImpl() const |
Inherited Methods from IloExtractable |
---|
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, setName, setObject |
public IloPack()
This constructor creates an empty handle. You must initialize it before you use it.
public IloPack(IloPackI * impl)
This constructor creates a handle object from a pointer to an implementation object.
This constructor creates a constraint that maintains container
loads subject to the assignments of weighted items to containers.
should be placed in, counting from 0.
where
and
weight
must be the
same size, otherwise an instance of
IloException
is thrown.
This constructor creates a constraint that maintains container
loads subject to the assignments of weighted items to containers.
The number of containers used is also maintained.
should be placed in, counting from 0.
where
and
weight
must be the
same size, otherwise an instance of
IloException
is thrown.
This constructor creates a constraint that maintains container
loads subject to the assignments of weighted items to containers.
The set of containers used is also maintained.
should be placed in, counting from 0.
where
and
weight
must be the
same size, otherwise an instance of
IloException
is thrown.
can be obtained from the set by taking the cardinality of
the set.
See Also:
IloCard
public IloPackI * getImpl() const
This member function returns a pointer to the implementation object of the invoking handle.