Class IloPack
Definition file: ilconcert/ilomodel.h
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.
Constructor Summary |
---|
public | IloPack() |
public | IloPack(IloPack::ImplClass *) |
public | IloPack(const IloEnv, const IloIntExprArray, const IloIntExprArray, const IloIntArray, const char *) |
public | IloPack(const IloEnv, const IloIntExprArray, const IloIntExprArray, const IloInt, const char *) |
public | IloPack(const IloEnv, const IloIntExprArray, const IloIntExprArray, const char *) |
Method Summary |
---|
public IloPack::ImplClass * | getImpl() |
public IloPack()
This constructor creates an empty handle. You must initialize it before you use it.
public IloPack(IloPack::ImplClass * impl)
This constructor creates a handle object from a pointer to an implementation object.
This constructor creates a constraint that maintains the container
loads subject to the assignments of weighted items to containers.
load
is the array of loads, one for each container.
where
indicates, for each item, which container it
should be placed in, counting from 0. weight
is 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
, if specified becomes the name of the constraint.
This constructor creates a constraint that maintains the container
loads subject to the assignments of weighted items to containers.
load
is the array of loads, one for each container.
where
indicates, for each item, which container it
should be placed in, counting from 0. weight
is a
non-negative weight; all items have this weight.
name
, if specified becomes the name of the constraint.
This constructor creates a constraint that maintains the container
loads subject to the assignments of weighted items to containers.
load
is the array of loads, one for each container.
where
indicates, for each item, which container it
should be placed in, counting from 0. All items have unit weight.
name
, if specified becomes the name of the constraint.
public IloPack::ImplClass * getImpl()
This member function returns a pointer to the implementation object of the invoking handle.