Class DisjointConditional

  • All Implemented Interfaces:
    SatisfiedPresent, Stateful, UsesQueueVariable

    public class DisjointConditional
    extends Diff
    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.8
    • Field Detail

      • idNumber

        static java.util.concurrent.atomic.AtomicInteger idNumber
      • condVariables

        java.util.List<? extends IntVar>[] condVariables
      • exclusionList

        public ExclusiveList exclusionList
        It specifies what rectangles can conditionally overlap.
    • Constructor Detail

      • DisjointConditional

        public DisjointConditional​(Rectangle[] rectangles,
                                   ExclusiveList exclusionList,
                                   boolean doProfile)
        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​(java.util.List<java.util.List<? extends IntVar>> rectangles,
                                   java.util.List<java.util.List<java.lang.Integer>> exceptionIndices,
                                   java.util.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​(java.util.List<java.util.List<? extends IntVar>> rectangles,
                                   java.util.List<java.util.List<java.lang.Integer>> exceptionIndices,
                                   java.util.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​(java.util.List<? extends IntVar> o1,
                                   java.util.List<? extends IntVar> o2,
                                   java.util.List<? extends IntVar> l1,
                                   java.util.List<? extends IntVar> l2,
                                   java.util.List<java.util.List<java.lang.Integer>> exceptionIndices,
                                   java.util.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​(java.util.List<? extends IntVar> o1,
                                   java.util.List<? extends IntVar> o2,
                                   java.util.List<? extends IntVar> l1,
                                   java.util.List<? extends IntVar> l2,
                                   java.util.List<java.util.List<java.lang.Integer>> exceptionIndices,
                                   java.util.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,
                                   java.util.List<java.util.List<java.lang.Integer>> exceptionIndices,
                                   java.util.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,
                                   java.util.List<java.util.List<java.lang.Integer>> exceptionIndices,
                                   java.util.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 considered
        exceptionCondition - conditions for rectangles that may not be considered
        profile - it specifies if the profiles are being used and computed within that constraint.
      • DisjointConditional

        public DisjointConditional​(IntVar[][] rectangles,
                                   java.util.List<java.util.List<java.lang.Integer>> exceptionIndices,
                                   java.util.List<? extends IntVar> exceptionCondition)
        It creates Disjoint conditional constraint.
        Parameters:
        rectangles - the rectangles within a constraint.
        exceptionIndices - list of rectangles that may not be considered
        exceptionCondition - conditions for rectangles that may not be considered
      • DisjointConditional

        public DisjointConditional​(IntVar[][] rectangles,
                                   java.util.List<java.util.List<java.lang.Integer>> exceptionIndices,
                                   java.util.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 considered
        exceptionCondition - conditions for rectangles that may not be considered
        profile - it specifies if the profiles are being computed and used within that constraint.
    • Method Detail

      • conditionChanged

        boolean conditionChanged​(java.util.Set<IntVar> fdvQueue,
                                 int j)
      • findMaxLength

        int findMaxLength​(int i,
                          int length,
                          Rectangle r)
      • impose

        public void impose​(Store store)
        Description copied from class: Constraint
        It imposes the constraint in a given store.
        Overrides:
        impose in class Constraint
        Parameters:
        store - the constraint store to which the constraint is imposed to.
      • minForbiddenInterval

        Interval minForbiddenInterval​(int start,
                                      int i,
                                      Rectangle r,
                                      java.util.List<IntRectangle> ConsideredRect,
                                      int minI)
      • 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 interface SatisfiedPresent
        Overrides:
        satisfied in class Diff
        Returns:
        true if constraint is possible to verify that it is satisfied.
      • toString

        public java.lang.String toString()
        Description copied from class: Constraint
        It produces a string representation of a constraint state.
        Overrides:
        toString in class Diff