org.cpsolver.ifs.extension

## Class MacPropagation.NoGood

- java.lang.Object
- - org.cpsolver.ifs.extension.MacPropagation.NoGood

- All Implemented Interfaces:
    AssignmentContext
  Enclosing class:
    MacPropagation<V extends Variable<V,T>,T extends Value<V,T>>

      public class MacPropagation.NoGood
      extends Object
      implements AssignmentContext

  Assignment context

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NoGood(Assignment<V,T> assignment)` Initialization.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<T>` | `getNoGood(T value)`
    `Set<T>[]` | `getNoGood(V variable)`
    `protected void` | `propagate(Assignment<V,T> assignment, Queue<V> queue)` Propagation over the queue of variables.
    `protected void` | `propagate(Assignment<V,T> assignment, V variable)` Propagation over the given variable.
    `protected boolean` | `propagate(Assignment<V,T> assignment, V aVariable, V anotherVariable)`
    `protected boolean` | `propagate(Assignment<V,T> assignment, V aVariable, V anotherVariable, List<T> adepts)`
    `void` | `setNoGood(T value, Set<T> noGood)`
    `void` | `setNoGood(V variable, Set<T>[] noGood)`
    `void` | `undoPropagate(Assignment<V,T> assignment, V variable)` Propagation undo over the given variable.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NoGood

          public NoGood(Assignment<V,T> assignment)

      Initialization. Enforce arc-consistency over the current (initial) solution. AC3 algorithm is used.

  - ### Method Detail

    - #### getNoGood

          public Set<T>[] getNoGood(V variable)

    - #### setNoGood

          public void setNoGood(V variable,
                                Set<T>[] noGood)

    - #### getNoGood

          public Set<T> getNoGood(T value)

    - #### setNoGood

          public void setNoGood(T value,
                                Set<T> noGood)

    - #### propagate

          protected boolean propagate(Assignment<V,T> assignment,
                                      V aVariable,
                                      V anotherVariable,
                                      List<T> adepts)

    - #### propagate

          protected boolean propagate(Assignment<V,T> assignment,
                                      V aVariable,
                                      V anotherVariable)

    - #### propagate

          protected void propagate(Assignment<V,T> assignment,
                                   V variable)

      Propagation over the given variable.
      Parameters:
        `assignment` - current assignment
        `variable` - given variable

    - #### propagate

          protected void propagate(Assignment<V,T> assignment,
                                   Queue<V> queue)

      Propagation over the queue of variables.
      Parameters:
        `assignment` - current assignment
        `queue` - variable queue

    - #### undoPropagate

          public void undoPropagate(Assignment<V,T> assignment,
                                    V variable)

      Propagation undo over the given variable. All values having given variable in thair explanations needs to be recomputed. This is done in two phases: 1) values that contain this variable in explanation are returned back to domains (marked as good) 2) propagation over variables which contains a value that was marked as good takes place
      Parameters:
        `assignment` - current assignment
        `variable` - given variable