Class DecomposedConstraint<T extends Constraint>

java.lang.Object
org.jacop.constraints.DecomposedConstraint<T>
Direct Known Subclasses:
AndBool, Arithmetic, Constraint, CosPeqR_decomposed, DiffnDecomposed, Lex, OrBool, Sequence, SoftAlldifferent, SoftGCC, Stretch

public abstract class DecomposedConstraint<T extends Constraint> extends Object
Standard unified interface/abstract class for constraints, which can only be decomposed. Defines how to construct a constraint out of other constraints.
Version:
4.8
  • Field Details

    • queueIndex

      public int queueIndex
      It specifies the queue (index), which is used to record that constraint needs to be re-evaluated.

      Priorytet 0 - O(c), constant execution time, e.g. primitive constraints Priorytet 1 - O(n), linear execution time, e.g. Sum, SumWeight Priorytet 2 - O(n^2) quadratic execution time, e.g. Cumulative Diff2 Priorytet 3 - polynomial execution time Priorytet 4 - execution time can be exponential in worst case, SumWeightDom

  • Constructor Details

    • DecomposedConstraint

      public DecomposedConstraint()
  • Method Details

    • imposeDecomposition

      public abstract void imposeDecomposition(Store store)
      It imposes the constraint in a given store.
      Parameters:
      store - the constraint store to which the constraint is imposed to.
    • imposeDecomposition

      public void imposeDecomposition(Store store, int queueIndex)
      It imposes the constraint and adjusts the queue index.
      Parameters:
      store - the constraint store to which the constraint is imposed to.
      queueIndex - the index of the queue in the store it is assigned to.
    • decompose

      public abstract List<T> decompose(Store store)
      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.
      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()
      Returns:
      null if no auxiliary variables were created, otherwise a list with variables.
    • checkInputForNullness

      public void checkInputForNullness(String[] a, Object[]... parameters)
    • checkInputForNullness

      public void checkInputForNullness(String a, Object[] parameters)
    • checkInputForDuplication

      public void checkInputForDuplication(String a, Object[] parameters)
    • checkInputForDuplicationSkipSingletons

      public void checkInputForDuplicationSkipSingletons(String a, Var[] parameters)
    • getDubletonsSkipSingletons

      public static Set<Var> getDubletonsSkipSingletons(Var[] parameters)
    • checkInputForNullness

      public void checkInputForNullness(String a, int[] parameters)
    • checkInput

      public <T> void checkInput(T[] list, Predicate<T> condition, String conditionDescription)
    • checkInput

      public void checkInput(int[] list, Predicate<Integer> condition, String conditionDescription)
    • derivative

      public FloatVar derivative(Store store, FloatVar f, Set<FloatVar> vars, FloatVar x)