| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |

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.
Note: This constraint cannot be used in a logical constraint.
| Method Summary | |
|---|---|
public IloPackI * | getImpl() const |
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) |
Inherited Methods from IloConstraint |
|---|
getImpl, IloConstraint, IloConstraint |
Inherited Methods from IloIntExprArg |
|---|
getImpl, IloIntExprArg, IloIntExprArg |
Inherited Methods from IloNumExprArg |
|---|
getImpl, IloNumExprArg, IloNumExprArg |
Inherited Methods from IloExtractable |
|---|
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, IloExtractable, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, removeFromAll, setLocation, setName, setObject |
| Method Detail |
|---|
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.
| env |
The environment used for allocating the constraint.
|
| load |
The array of loads, one for each container.
|
| where |
For each item, which container it
should be placed in, counting from 0.
|
| weight |
An array of nonnegative weights, one for each item.
where and weight must be the
same size, otherwise an instance of
IloException is thrown.
|
| name |
The name of the constraint.
|
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.
| env |
The environment used for allocating the constraint.
|
| load |
The array of loads, one for each container.
|
| where |
For each item, which container it
should be placed in, counting from 0.
|
| weight |
An array of nonnegative weights, one for each item.
where and weight must be the
same size, otherwise an instance of
IloException is thrown.
|
| used |
The number of containers used.
|
| name |
The name of the constraint.
|