Class 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
    • 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:
        imposeDecomposition in class DecomposedConstraint<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: DecomposedConstraint
        It 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:
        decompose in class DecomposedConstraint<Constraint>
        Parameters:
        store - the constraint store in which context the decomposition takes place.
        Returns:
        an array list of constraints used to decompose this constraint.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object