Package org.jacop.constraints
Class DisjointConditional
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.Diff
org.jacop.constraints.DisjointConditional
- All Implemented Interfaces:
SatisfiedPresent
,Stateful
,UsesQueueVariable
DisjointConditional constraint assures that any two rectangles from a vector
of rectangles does not overlap in at least one direction. The execption from
this rule is specified on the list of tuple [recti, rectj, C], where recti
and rectj are integers representing given rectangles positions on the list of
rectangles (starting from 1) and C is FDV 0..1. When C=1 then rectnagles must
not overlap otherwise the overlaping is not checked.
- Version:
- 4.9
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) DisjointCondVar[]
It specifies what rectangles can conditionally overlap.(package private) static AtomicInteger
(package private) static final boolean
(package private) static final boolean
Fields inherited from class org.jacop.constraints.Diff
currentStore, dimIthMinComparator, doProfile, rectangles, stamp, variableQueue
Fields inherited from class org.jacop.constraints.Constraint
afcWeight, atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, watchedVariableGrounded
Fields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex
-
Constructor Summary
ConstructorsConstructorDescriptionDisjointConditional
(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition) It constructs a disjoint conditional constraint.DisjointConditional
(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition, boolean profile) It constructs a disjoint conditional constraint.DisjointConditional
(List<List<? extends IntVar>> rectangles, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition) It creates Disjoint conditional constraint.DisjointConditional
(List<List<? extends IntVar>> rectangles, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition, boolean profile) It creates Disjoint conditional constraint.DisjointConditional
(Rectangle[] rectangles, ExclusiveList exclusionList, boolean doProfile) It specifies a diff constraint.DisjointConditional
(IntVar[][] rectangles, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition) It creates Disjoint conditional constraint.DisjointConditional
(IntVar[][] rectangles, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition, boolean profile) It creates Disjoint conditional constraint.DisjointConditional
(IntVar[] origin1, IntVar[] origin2, IntVar[] length1, IntVar[] length2, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition) It constructs a disjoint conditional constraint.DisjointConditional
(IntVar[] o1, IntVar[] o2, IntVar[] l1, IntVar[] l2, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition, boolean profile) It constructs a disjoint conditional constraint. -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
(package private) boolean
conditionChanged
(Set<IntVar> fdvQueue, int j) (package private) boolean
doesNotFit
(int j, Rectangle r, Profile barrier) (package private) int
findMaxLength
(int i, int length, Rectangle r) (package private) boolean
findRectangles
(Rectangle r, int index, List<IntRectangle> UsedRect, List<RectangleWithCondition> ProfileCandidates, List<RectangleWithCondition> OverlappingRects, Set<IntVar> fdvQueue) void
It imposes the constraint in a given store.(package private) Interval
minForbiddenInterval
(int start, int i, Rectangle r, List<IntRectangle> ConsideredRect, int minI) (package private) void
narrowIthCondition
(int i, Rectangle r, List<IntRectangle> UsedRect, List<RectangleWithCondition> ProfileCandidates) (package private) void
narrowRectangleCondition
(Rectangle r, List<IntRectangle> UsedRect, List<RectangleWithCondition> ProfileCandidates) (package private) void
narrowRectangles
(Set<IntVar> fdvQueue) (package private) boolean
notFit
(int i, Rectangle r, List<IntRectangle> ConsideredRect) (package private) void
profileCheckInterval
(Store store, DisjointConditionalProfile Profile, int limit, IntVar Start, IntVar Duration, int _min, int _max, IntVar Resources) (package private) void
profileCheckRectangle
(DisjointConditionalProfile Profile, Rectangle r, int i, int j) (package private) void
profileNarrowingCondition
(int i, Rectangle r, List<RectangleWithCondition> ProfileCandidates) boolean
It 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, profileNarrowing, queueVariable, removeLevel
Methods 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, watchedVariableGrounded
Methods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jacop.api.Stateful
isStateful
-
Field Details
-
idNumber
-
trace
static final boolean trace- See Also:
-
traceNarr
static final boolean traceNarr- See Also:
-
condVariables
-
evalRects
DisjointCondVar[] evalRects -
exclusionList
It specifies what rectangles can conditionally overlap.
-
-
Constructor Details
-
DisjointConditional
It specifies a diff constraint.- Parameters:
rectangles
- list of rectangles which can not overlap in at least one dimension.exclusionList
- it is a list of exclusive items. Each item consists of two ints and a variable.doProfile
- should the constraint compute and use the profile functionality.
-
DisjointConditional
public DisjointConditional(List<List<? extends IntVar>> rectangles, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition) It creates Disjoint conditional constraint.- Parameters:
rectangles
- the rectangles within a constraint.exceptionIndices
- a list of pairs of conditionally overlaping rectangles.exceptionCondition
- a variable specifying if a corresponding pair is nonoverlapping.
-
DisjointConditional
public DisjointConditional(List<List<? extends IntVar>> rectangles, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition, boolean profile) It creates Disjoint conditional constraint.- Parameters:
rectangles
- the rectangles within a constraint.exceptionIndices
- it specifies a list of pairs, where each pair specifies two rectangles which conditionally overlap.exceptionCondition
- a variable specifying if a corresponding pair is nonoverlapping.profile
- it specifies if the profiles are used and computed within the constraint.
-
DisjointConditional
public DisjointConditional(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition) It constructs a disjoint conditional constraint.- Parameters:
o1
- variables specifying the origin in the first dimension.o2
- variables specifying the origin in the second dimension.l1
- variables specifying the length in the first dimension.l2
- variables specifying the length in the second dimension.exceptionIndices
- it specifies a list of pairs, where each pair specifies two rectangles which conditionally overlap.exceptionCondition
- a variable specifying if a corresponding pair is nonoverlapping.
-
DisjointConditional
public DisjointConditional(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition, boolean profile) It constructs a disjoint conditional constraint.- Parameters:
o1
- variables specifying the origin in the first dimension.o2
- variables specifying the origin in the second dimension.l1
- variables specifying the length in the first dimension.l2
- variables specifying the length in the second dimension.exceptionIndices
- it specifies a list of pairs, where each pair specifies two rectangles which conditionally overlap.exceptionCondition
- a variable specifying if a corresponding pair is nonoverlapping.profile
- it specifies if the profiles are being computed and used within a constraint.
-
DisjointConditional
public DisjointConditional(IntVar[] origin1, IntVar[] origin2, IntVar[] length1, IntVar[] length2, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition) It constructs a disjoint conditional constraint.- Parameters:
origin1
- variables specifying the origin in the first dimension.origin2
- variables specifying the origin in the second dimension.length1
- variables specifying the length in the first dimension.length2
- variables specifying the length in the second dimension.exceptionIndices
- it specifies a list of pairs, where each pair specifies two rectangles which conditionally overlap.exceptionCondition
- a variable specifying if a corresponding pair is nonoverlapping.
-
DisjointConditional
public DisjointConditional(IntVar[] o1, IntVar[] o2, IntVar[] l1, IntVar[] l2, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition, boolean profile) It constructs a disjoint conditional constraint.- Parameters:
o1
- variables specifying the origin in the first dimension.o2
- variables specifying the origin in the second dimension.l1
- variables specifying the length in the first dimension.l2
- variables specifying the length in the second dimension.exceptionIndices
- list of rectangles that may not be consideredexceptionCondition
- conditions for rectangles that may not be consideredprofile
- it specifies if the profiles are being used and computed within that constraint.
-
DisjointConditional
public DisjointConditional(IntVar[][] rectangles, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition) It creates Disjoint conditional constraint.- Parameters:
rectangles
- the rectangles within a constraint.exceptionIndices
- list of rectangles that may not be consideredexceptionCondition
- conditions for rectangles that may not be considered
-
DisjointConditional
public DisjointConditional(IntVar[][] rectangles, List<List<Integer>> exceptionIndices, List<? extends IntVar> exceptionCondition, boolean profile) It creates Disjoint conditional constraint.- Parameters:
rectangles
- the rectangles within a constraint.exceptionIndices
- list of rectangles that may not be consideredexceptionCondition
- conditions for rectangles that may not be consideredprofile
- it specifies if the profiles are being computed and used within that constraint.
-
-
Method Details
-
checkRect
-
conditionChanged
-
doesNotFit
-
findMaxLength
-
findRectangles
boolean findRectangles(Rectangle r, int index, List<IntRectangle> UsedRect, List<RectangleWithCondition> ProfileCandidates, List<RectangleWithCondition> OverlappingRects, Set<IntVar> fdvQueue) -
impose
Description copied from class:Constraint
It imposes the constraint in a given store.- Overrides:
impose
in classConstraint
- Parameters:
store
- the constraint store to which the constraint is imposed to.
-
minForbiddenInterval
Interval minForbiddenInterval(int start, int i, Rectangle r, List<IntRectangle> ConsideredRect, int minI) -
narrowIthCondition
void narrowIthCondition(int i, Rectangle r, List<IntRectangle> UsedRect, List<RectangleWithCondition> ProfileCandidates) -
narrowRectangleCondition
void narrowRectangleCondition(Rectangle r, List<IntRectangle> UsedRect, List<RectangleWithCondition> ProfileCandidates) -
narrowRectangles
- Overrides:
narrowRectangles
in classDiff
-
notFit
-
profileCheckInterval
void profileCheckInterval(Store store, DisjointConditionalProfile Profile, int limit, IntVar Start, IntVar Duration, int _min, int _max, IntVar Resources) -
profileCheckRectangle
-
profileNarrowingCondition
-
satisfied
public boolean satisfied()Description copied from interface:SatisfiedPresent
It 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:
satisfied
in interfaceSatisfiedPresent
- Overrides:
satisfied
in classDiff
- Returns:
- true if constraint is possible to verify that it is satisfied.
-
toString
Description copied from class:Constraint
It produces a string representation of a constraint state.
-