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.10
  • Field Details

  • Constructor Details

    • DiffnDecomposed

      public DiffnDecomposed(IntVar[][] rectangle)
      It specifies a diffn 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 diffn 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(List<? extends 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(List<? extends IntVar> x, List<? extends IntVar> y, List<? extends IntVar> lx, List<? extends IntVar> ly)
      It constructs a diffn 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 Details

    • 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 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.
    • auxiliaryVariables

      public List<Var> auxiliaryVariables()
      Overrides:
      auxiliaryVariables in class DecomposedConstraint<Constraint>
      Returns:
      null if no auxiliary variables were created, otherwise a list with variables.
    • toString

      public String toString()
      Overrides:
      toString in class Object