Module org.maxicp

Interface DeltaCPIntVar

All Superinterfaces:
Delta, Iterable<Integer>
All Known Implementing Classes:
DeltaCPIntVarImpl

public interface DeltaCPIntVar extends Delta, Iterable<Integer>
Object that allows to retrieve in a constraint the changes of the domain of a variable from one call to the Constraint.propagate to the next. This is also called the delta set. This functionality is useful to implement incremental filtering algorithm in some global constraints that rely on the changes of the domains.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Tells if the domain has changed since previous call to Constraint#propagate
    int
    fillArray(int[] values)
    Fill the prefix of the array with the values in the delta set.
    An iterator on the delta set This iterator is not computed lazily
    boolean
    Tells if the maximum has changed in the domain since previous call to Constraint#propagate
    boolean
    Tells if the minimum has changed in the domain since previous call to Constraint#propagate
    int
    The old max of the domain in previous call to Constraint#propagate
    int
    The old min of the domain in previous call to Constraint#propagate
    int
    The old size of the domain in previous call to Constraint#propagate
    int
    The size of the delta set since previous call to Constraint#propagate
    The variable related to this delta set

    Methods inherited from interface org.maxicp.cp.engine.core.Delta

    update

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • variable

      CPIntVar variable()
      The variable related to this delta set
      Returns:
      the variable related to this delta set
    • oldMin

      int oldMin()
      The old min of the domain in previous call to Constraint#propagate
      Returns:
      the previous minimum
    • oldMax

      int oldMax()
      The old max of the domain in previous call to Constraint#propagate
      Returns:
      the previous maximum of the domain
    • oldSize

      int oldSize()
      The old size of the domain in previous call to Constraint#propagate
      Returns:
      the previous size of the domain
    • changed

      boolean changed()
      Tells if the domain has changed since previous call to Constraint#propagate
      Returns:
      if the domain has changed
    • size

      int size()
      The size of the delta set since previous call to Constraint#propagate
      Returns:
      the size of the delta set
    • minChanged

      boolean minChanged()
      Tells if the minimum has changed in the domain since previous call to Constraint#propagate
      Returns:
    • maxChanged

      boolean maxChanged()
      Tells if the maximum has changed in the domain since previous call to Constraint#propagate
      Returns:
    • iterator

      Iterator<Integer> iterator()
      An iterator on the delta set This iterator is not computed lazily
      Specified by:
      iterator in interface Iterable<Integer>
      Returns:
      an iterator on the delta set
    • fillArray

      int fillArray(int[] values)
      Fill the prefix of the array with the values in the delta set.
      Parameters:
      values - the array to fill, its size should be large enough that is at least oldSize-current domain size.
      Returns:
      the size of the prefix that contains the delta set