Overview | Group | Tree | Graph | 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, indicating 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 IloConstraint |
---|
getImpl |
Inherited Methods from IloIntExprArg |
---|
getImpl |
Inherited Methods from IloNumExprArg |
---|
getImpl |
Inherited Methods from IloExtractable |
---|
end, getEnv, getId, getImpl, getName, getObject, setName, setObject |
Constructor 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 non-negative 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 non-negative 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.
|
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
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 non-negative weights, one for each item.
where and weight must be the
same size, otherwise an instance of
IloException is thrown.
|
used |
The set of containers used. The number of containers used
can be obtained from the set by taking the cardinality of
the set.
|
name |
The name of the constraint.
|
Method Detail |
---|