Package org.jacop.constraints.diffn
Class Nooverlap
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.diffn.Nooverlap
- Direct Known Subclasses:
Diffn
Nooverlap constraint assures that any two rectangles from a vector of rectangles
does not overlap in at least one direction. It is a simple implementation which
does not use sophisticated techniques for efficient backtracking.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean(package private) static AtomicIntegerDefines first position of the variable that is not ground to 1(package private) Rectangle[]It specifies the list of rectangles which are of interest for this diff constraint.(package private) intcurrent stamp(package private) Store(package private) booleandefines how to treat rectangles with width zero strict = true means they still need to be between other rectangles strict = false these rectangles can be anywhere(package private) static final boolean(package private) static final boolean(package private) static final int(package private) static final intFields inherited from class org.jacop.constraints.Constraint
atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scopeFields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex -
Constructor Summary
ConstructorsConstructorDescriptionIt specifies a diffn constraint.It specifies a diffn constraint.Nooverlap(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2) It constructs a diff constraint.Nooverlap(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2, boolean strict) It constructs a diff constraint.It specifies a diff constraint.It specifies a diff constraint.It constructs a diff constraint.It constructs a diff constraint. -
Method Summary
Modifier and TypeMethodDescriptionvoidconsistency(Store store) It is a (most probably incomplete) consistency function which removes the values from variables domains.(package private) voidenergyCheck(Rectangle r, BitSet rects) intvoidIt imposes the constraint in a given store.boolean(package private) voidprivate void(package private) voidpruning()booleantoString()It produces a string representation of a constraint state.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, queueVariable, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, updateAFC, watchedVariableGroundedMethods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
-
Field Details
-
idNumber
-
trace
static final boolean trace- See Also:
-
traceNarr
static final boolean traceNarr- See Also:
-
x
static final int x- See Also:
-
y
static final int y- See Also:
-
strict
boolean strictdefines how to treat rectangles with width zero strict = true means they still need to be between other rectangles strict = false these rectangles can be anywhere -
store
Store store -
rectangle
Rectangle[] rectangleIt specifies the list of rectangles which are of interest for this diff constraint. -
overlapping
Defines first position of the variable that is not ground to 1 -
stamp
int stampcurrent stamp -
doAreaCheck
boolean doAreaCheck
-
-
Constructor Details
-
Nooverlap
It specifies a diff constraint.- Parameters:
rectangle- list of rectangles which can not overlap in at least one dimension.
-
Nooverlap
It specifies a diff constraint.- Parameters:
rectangle- list of rectangles which can not overlap in at least one dimension.strict- true- zero size rectangles need to be between other rectangles; false- these rectangles can be anywhere
-
Nooverlap
It constructs a diff constraint.- Parameters:
origin1- list of variables denoting origin of the rectangle in the first dimension.origin2- list of variables denoting origin of the rectangle in the second dimension.length1- list of variables denoting length of the rectangle in the first dimension.length2- list of variables denoting length of the rectangle in the second dimension.
-
Nooverlap
public Nooverlap(IntVar[] origin1, IntVar[] origin2, IntVar[] length1, IntVar[] length2, boolean strict) It constructs a diff constraint.- Parameters:
origin1- list of variables denoting origin of the rectangle in the first dimension.origin2- list of variables denoting origin of the rectangle in the second dimension.length1- list of variables denoting length of the rectangle in the first dimension.length2- list of variables denoting length of the rectangle in the second dimension.strict- true- zero size rectangles need to be between other rectangles; false- these rectangles can be anywhere
-
Nooverlap
It specifies a diffn constraint.- Parameters:
rectangle- list of rectangles which can not overlap in at least one dimension.
-
Nooverlap
It specifies a diffn constraint.- Parameters:
rectangle- list of rectangles which can not overlap in at least one dimension.strict- true- zero size rectangles need to be between other rectangles; false- these rectangles can be anywhere
-
Nooverlap
public Nooverlap(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2) It constructs a diff constraint.- Parameters:
o1- list of variables denoting origin of the rectangle in the first dimension.o2- list of variables denoting origin of the rectangle in the second dimension.l1- list of variables denoting length of the rectangle in the first dimension.l2- list of variables denoting length of the rectangle in the second dimension.
-
Nooverlap
public Nooverlap(List<? extends IntVar> o1, List<? extends IntVar> o2, List<? extends IntVar> l1, List<? extends IntVar> l2, boolean strict) It constructs a diff constraint.- Parameters:
o1- list of variables denoting origin of the rectangle in the first dimension.o2- list of variables denoting origin of the rectangle in the second dimension.l1- list of variables denoting length of the rectangle in the first dimension.l2- list of variables denoting length of the rectangle in the second dimension.strict- true- zero size rectangles need to be between other rectangles; false- these rectangles can be anywhere
-
-
Method Details
-
consistency
Description copied from class:ConstraintIt is a (most probably incomplete) consistency function which removes the values from variables domains. Only values which do not have any support in a solution space are removed.- Specified by:
consistencyin classConstraint- Parameters:
store- constraint store within which the constraint consistency is being checked.
-
pruning
void pruning() -
prune
-
prune
-
energyCheck
-
getDefaultConsistencyPruningEvent
public int getDefaultConsistencyPruningEvent()- Specified by:
getDefaultConsistencyPruningEventin classConstraint
-
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.
-
satisfied
public boolean satisfied() -
notSatisfied
public boolean notSatisfied() -
toString
Description copied from class:ConstraintIt produces a string representation of a constraint state.- Overrides:
toStringin classConstraint
-