Overview | Group | Tree | Graph | Index | Concepts |
Instances of the class IlcBox
are multidimensional boxes
that appear in multidimensional placement problems. To solve packing or
placement problems, you may need to be able to place boxes within a given
container. In such a situation, both the boxes to place and the container to
hold them are instances of the class IlcBox
.
To specify the containment constraint that a given container holds a
given box, use the member function IlcBox::contains
.
Backtracking and Reversibility
All the member functions and operators defined for this class and capable of modifying constrained variables are reversible. In particular, the changes made by constraint-posting functions are made with reversible assignments. Thus the value of the domain, and the constraints posted on any constrained variable are restored when Solver backtracks.
For more information, see IloBox
.
See Also:
IlcBoxIterator, IlcFilterLevelConstraint, IloBox
Constructor and Destructor Summary | |
---|---|
public | IlcBox(IlcInt dimensions, IlcIntVarArray origin, IlcIntArray size) |
Method Summary | |
---|---|
public IlcConstraint | contains(IlcBox box) |
public IlcBool | doesNotOverlapInDimension(IlcBox box1, IlcBox box2, IlcInt dimension) |
public IlcBool | doesOverlapInDimension(IlcBox box1, IlcBox box2, IlcInt dimension) |
public IlcBool | doesPrecedeInDimension(IlcBox box1, IlcBox box2, IlcInt dimension) |
public IlcInt | getDimensions() |
public IlcBoxI * | getImpl() const |
public IlcConstraint | getNotOverlapConstraint() |
public IlcAny | getObject() const |
public IlcIntVar | getOrigin(IlcInt dimension) |
public IlcInt | getSize(IlcInt dimension) |
public IloSolver | getSolver() const |
public IlcBool | isContained(IlcBox box) |
public IlcConstraint | notOverlapInDimension(IlcBox box1, IlcBox box2, IlcInt dimension) |
public IlcBool | notOverlapInDimensionKnown(IlcBox box1, IlcBox box2, IlcInt dimension) |
public IlcConstraint | overlapInDimension(IlcBox box1, IlcBox box2, IlcInt dimension) |
public IlcBool | overlapInDimensionKnown(IlcBox box1, IlcBox box2, IlcInt dimension) |
public IlcConstraint | precedenceInDimension(IlcBox box1, IlcBox box2, IlcInt dimension) |
public IlcBool | precedenceInDimensionKnown(IlcBox box1, IlcBox box2, IlcInt dimension) |
public void | setObject(IlcAny object) |
Inherited Methods from IlcConstraint |
---|
getImpl, getName, getObject, getParentDemon, getSolver, isFalse, isTrue, setName, setObject |
Inherited Methods from IlcDemon |
---|
getConstraint, getImpl, getSolver, operator= |
Constructor and Destructor Detail |
---|
This constructor creates a box according to the specifications passed in the parameters. The parameter dimensions
indicates the number of dimensions the box has. The arrays origin
and size
must contain the same number of elements as the number of dimensions of the box. In dimension i, the box extends from origin[
i]
to origin[
i]
+ size[
i]
. For example, the statement
IlcBox(2,IlcIntVarArray(s,2,IlcIntVar(s,3,3),IlcIntVar(s,0,0)), IlcIntArray(s,2,8,4));
creates a box as shown in the illustration below.
Method Detail |
---|
This member function creates a constraint that requires the invoking box to contain box
. The parameter box
should have the same number of dimensions as the invoking box.
This member function is reversible. That is, if a failure causes Solver to backtrack to an earlier choice point, the effect of the contains
statement is undone automatically.
This member function returns IlcTrue
if the corresponding notOverlapInDimension
constraint is verified. Otherwise, it returns IlcFalse
.
This member function returns IlcTrue
if the corresponding overlapInDimension
constraint is verified. Otherwise, it returns IlcFalse
.
This member function returns IlcTrue
if the corresponding precedenceInDimension
constraint is verified. Otherwise, it returns IlcFalse
.
This member function returns the number of dimensions of the invoking box.
This member function returns the implementation object of the invoking object. You can use this member function to check whether a constraint is empty.
This member function returns a constraint that specifies that none of the boxes contained in the invoking box can overlap simultaneously along all of their dimensions.
The filter level of this constraint can be set using IloSolver::setFilterLevel
. Currently two filter levels are allowed, IlcLow
, the default, and IlcBasic
, which is slower but propagates more. You can specify the default filter level of this constraint using the method IloSolver::setDefaultFilterLevel
.
This member function returns the object associated with the invoking box.
This member function returns the origin of the invoking box along dimension dimension
.
This member function returns the length of the invoking box along dimension dimension
.
This member function returns the solver associated with the invoking box.
This member function returns IlcTrue
if the invoking box object is contained in box
. Otherwise, it returns IlcFalse
.
This member function specifies the constraint that if box1
and box2
are contained in the invoking box, then box1
and box2
must not overlap along dimension dimension
.
This member function returns IlcTrue
if the truth value of the corresponding notOverlapInDimension
constraint is known. Otherwise, it returns IlcFalse
.
This member function specifies the constraint that if box1
and box2
are contained in the invoking box, then box1
and box2
must overlap along dimension dimension
.
This member function returns IlcTrue
if the truth value of the corresponding overlapInDimension
constraint is known. Otherwise, it returns IlcFalse
.
This member function specifies the constraint that if box1
and box2
are contained in the invoking box, then box1
must precede box2
in dimension
.
This member function returns IlcTrue
if the truth value of the corresponding precedenceInDimension
constraint is known. Otherwise, it returns IlcFalse
.
This member function sets the object associated with the invoking box to object
.