Package org.jacop.constraints.diffn
Class DiffnDecomposed
- java.lang.Object
-
- org.jacop.constraints.DecomposedConstraint<Constraint>
-
- org.jacop.constraints.diffn.DiffnDecomposed
-
public class DiffnDecomposed extends DecomposedConstraint<Constraint>
Diffn 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.8
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Var>auxVarprivate java.util.List<Constraint>constraints(package private) IntVar[]lx(package private) IntVar[]ly(package private) IntVar[]x(package private) IntVar[]y-
Fields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex
-
-
Constructor Summary
Constructors Constructor Description DiffnDecomposed(java.util.List<? extends java.util.List<? extends IntVar>> rectangle)It specifies a diffn constraint.DiffnDecomposed(java.util.List<? extends IntVar> x, java.util.List<? extends IntVar> y, java.util.List<? extends IntVar> lx, java.util.List<? extends IntVar> ly)It constructs a diff constraint.DiffnDecomposed(IntVar[][] rectangle)It specifies a diff constraint.DiffnDecomposed(IntVar[] origin1, IntVar[] origin2, IntVar[] length1, IntVar[] length2)It constructs a diff constraint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Var>auxiliaryVariables()java.util.List<Constraint>decompose(Store store)It returns an array list of constraint which are used to decompose this constraint.voidimposeDecomposition(Store store)It imposes DiffnDecomposed in a given store.java.lang.StringtoString()-
Methods inherited from class org.jacop.constraints.DecomposedConstraint
checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
-
-
-
-
Constructor Detail
-
DiffnDecomposed
public DiffnDecomposed(IntVar[][] rectangle)
It specifies a diff constraint.- Parameters:
rectangle- list of rectangles which can not overlap in at least one dimension.
-
DiffnDecomposed
public DiffnDecomposed(IntVar[] origin1, IntVar[] origin2, IntVar[] length1, IntVar[] length2)
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.
-
DiffnDecomposed
public DiffnDecomposed(java.util.List<? extends java.util.List<? extends IntVar>> rectangle)
It specifies a diffn constraint.- Parameters:
rectangle- list of rectangles which can not overlap in at least one dimension.
-
DiffnDecomposed
public DiffnDecomposed(java.util.List<? extends IntVar> x, java.util.List<? extends IntVar> y, java.util.List<? extends IntVar> lx, java.util.List<? extends IntVar> ly)
It constructs a diff constraint.- Parameters:
x- list of variables denoting origin of the rectangle in the first dimension.y- list of variables denoting origin of the rectangle in the second dimension.lx- list of variables denoting length of the rectangle in the first dimension.ly- list of variables denoting length of the rectangle in the second dimension.
-
-
Method Detail
-
imposeDecomposition
public void imposeDecomposition(Store store)
It imposes DiffnDecomposed in a given store.- Specified by:
imposeDecompositionin classDecomposedConstraint<Constraint>- Parameters:
store- the constraint store to which the constraint is imposed to.
-
decompose
public java.util.List<Constraint> decompose(Store store)
Description copied from class:DecomposedConstraintIt returns an array list of constraint which are used to decompose this constraint. It actually creates a decomposition (possibly also creating variables), but it does not impose the constraint.- Specified by:
decomposein classDecomposedConstraint<Constraint>- Parameters:
store- the constraint store in which context the decomposition takes place.- Returns:
- an array list of constraints used to decompose this constraint.
-
auxiliaryVariables
public java.util.List<Var> auxiliaryVariables()
- Overrides:
auxiliaryVariablesin classDecomposedConstraint<Constraint>- Returns:
- null if no auxiliary variables were created, otherwise a list with variables.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-