Class PartitionSet

All Implemented Interfaces:
UsesQueueVariable

public class PartitionSet extends Constraint implements UsesQueueVariable
Channel constraint requires that array of int variables x and array of set variables y are related such that (x[i] = j) <-> (i in s[j]). Indexes start form 0, both for integer and set variables, by default. To define other starting index use offset definitions.
Version:
4.10
  • Field Details

  • Constructor Details

    • PartitionSet

      public PartitionSet(SetVar[] s, IntDomain universe)
      It constructs a Channel constraint.
      Parameters:
      s - array of set variables.
      universe - set of all values.
  • Method Details

    • consistency

      public void consistency(Store store) throws FailException
      Description copied from class: Constraint
      It is a (most probably incomplete) consistency function which removes the values from variables domains. Only values which do not have any support in a solution space are removed.
      Specified by:
      consistency in class Constraint
      Parameters:
      store - constraint store within which the constraint consistency is being checked.
      Throws:
      FailException
    • queueVariable

      public void queueVariable(int level, Var var)
      Description copied from class: Constraint
      This is a function called to indicate which variable in a scope of constraint has changed. It also indicates a store level at which the change has occurred.
      Overrides:
      queueVariable in class Constraint
      Parameters:
      level - the level of the store at which the change has occurred.
      var - variable which has changed.
    • getDefaultConsistencyPruningEvent

      public int getDefaultConsistencyPruningEvent()
      Specified by:
      getDefaultConsistencyPruningEvent in class Constraint
    • toString

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