Package org.jacop.constraints
Class Disjoint
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.Diff
org.jacop.constraints.Disjoint
- All Implemented Interfaces:
SatisfiedPresent,Stateful,UsesQueueVariable
Disjoint constraint assures that any two rectangles from a vector of
rectangles does not overlap in at least one direction.
Zero-width rectangles does not overlap with any other rectangle.
- Version:
- 4.10
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Diff2Var[](package private) static AtomicIntegerFields inherited from class org.jacop.constraints.Diff
currentStore, dimIthMinComparator, doProfile, rectangles, stamp, trace, variableQueueFields inherited from class org.jacop.constraints.Constraint
afcWeight, atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, watchedVariableGroundedFields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex -
Constructor Summary
ConstructorsConstructorDescriptionIt creates a diff2 constraint.It creates a diff2 constraint.Disjoint(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2) It creates a diff2 constraint.Disjoint(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2, boolean profile) It creates a diff2 constraint.It creates a diff2 constraint.It creates a diff2 constraint.It creates a diff2 constraint.It creates a diff2 constraint. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanfindRectangles(Rectangle r, int index, List<IntRectangle> UsedRect, List<Rectangle> ProfileCandidates, List<Rectangle> OverlappingRects, Set<IntVar> fdvQueue) voidIt imposes the constraint in a given store.(package private) voidnarrowRectangles(Set<IntVar> fdvQueue) (package private) voidprofileNarrowing(int i, Rectangle r, List<Rectangle> ProfileCandidates) booleanIt checks if the constraint is satisfied.toString()It produces a string representation of a constraint state.Methods inherited from class org.jacop.constraints.Diff
consistency, containsChangedVariable, getDefaultConsistencyPruningEvent, getRectangles, intervalOverlap, narrowRectangle, profileCheckRectangle, queueVariable, removeLevelMethods inherited from class org.jacop.constraints.Constraint
afc, arguments, cleanAfterFailure, decompose, getConsistencyPruningEvent, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, imposeDecomposition, increaseWeight, intArrayToString, long2int, numberArgs, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, toInt, toInt, updateAFC, watchedVariableGroundedMethods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecompositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jacop.api.Stateful
isStateful
-
Field Details
-
idNumber
-
evalRects
Diff2Var[] evalRects
-
-
Constructor Details
-
Disjoint
- Parameters:
rectangles- a list of rectangles.doProfile- should profile be computed and used.
-
Disjoint
public Disjoint(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2, boolean profile) It creates a diff2 constraint.- Parameters:
o1- list of variables denoting the origin in the first dimension.o2- list of variables denoting the origin in the second dimension.l1- list of variables denoting the length in the first dimension.l2- list of variables denoting the length in the second dimension.profile- specifies if the profile should be computed.
-
Disjoint
It creates a diff2 constraint.- Parameters:
rectangles- list of rectangles with origins and lengths in both dimensions.
-
Disjoint
It creates a diff2 constraint.- Parameters:
rectangles- list of rectangles with origins and lengths in both dimensions.profile- specifies if the profile is computed and used.
-
Disjoint
public Disjoint(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2) It creates a diff2 constraint.- Parameters:
o1- list of variables denoting the origin in the first dimension.o2- list of variables denoting the origin in the second dimension.l1- list of variables denoting the length in the first dimension.l2- list of variables denoting the length in the second dimension.
-
Disjoint
It creates a diff2 constraint.- Parameters:
origin1- list of variables denoting the origin in the first dimension.origin2- list of variables denoting the origin in the second dimension.length1- list of variables denoting the length in the first dimension.length2- list of variables denoting the length in the second dimension.
-
Disjoint
It creates a diff2 constraint.- Parameters:
o1- list of variables denoting the origin in the first dimension.o2- list of variables denoting the origin in the second dimension.l1- list of variables denoting the length in the first dimension.l2- list of variables denoting the length in the second dimension.profile- specifies if the profile should be computed.
-
Disjoint
It creates a diff2 constraint.- Parameters:
rectangles- list of rectangles with origins and lengths in both dimensions.
-
Disjoint
It creates a diff2 constraint.- Parameters:
rectangles- list of rectangles with origins and lengths in both dimensions.profile- specifies if the profile is computed and used.
-
-
Method Details
-
impose
Description copied from class:ConstraintIt imposes the constraint in a given store.- Overrides:
imposein classConstraint- Parameters:
store- the constraint store to which the constraint is imposed to.
-
narrowRectangles
- Overrides:
narrowRectanglesin classDiff
-
findRectangles
-
profileNarrowing
- Overrides:
profileNarrowingin classDiff
-
satisfied
public boolean satisfied()Description copied from interface:SatisfiedPresentIt checks if the constraint is satisfied. It can return false even if constraint is satisfied but not all variables in its scope are grounded. It needs to return true if all variables in its scope are grounded and constraint is satisfied.Implementations of this interface for constraints that are not PrimitiveConstraint may require constraint imposition and consistency check as a requirement to work correctly.
- Specified by:
satisfiedin interfaceSatisfiedPresent- Overrides:
satisfiedin classDiff- Returns:
- true if constraint is possible to verify that it is satisfied.
-
toString
Description copied from class:ConstraintIt produces a string representation of a constraint state.
-