org.cpsolver.ifs.extension

## Class MacRevised.NoGood

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

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

      public class MacRevised.NoGood
      extends Object
      implements AssignmentContext

  Assignment context

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<T>` | `explanation(Assignment<V,T> assignment, Constraint<V,T> constraint, T value, V variable)`
    `Set<T>` | `getNoGood(T value)`
    `Set<T>[]` | `getNoGood(V variable)`
    `Set<T>` | `goodValues(V variable)` good values of a variable (values not removed from variables domain)
    `boolean` | `hasSupport(Assignment<V,T> assignment, Constraint<V,T> constraint, T value, V variable)`
    `boolean` | `isGood(T value)` is variable good
    `Set<T>` | `noGood(T value)` variables explanation
    `void` | `propagate(Assignment<V,T> assignment, Constraint<V,T> constraint, T noGoodValue, List<T> queue)`
    `void` | `propagate(Assignment<V,T> assignment, List<T> queue)`
    `boolean` | `revise(Assignment<V,T> assignment, Constraint<V,T> constraint, T value)`
    `boolean` | `revise(Assignment<V,T> assignment, T value)`
    `protected void` | `setGood(T value)` sets value to be good
    `void` | `setNoGood(Assignment<V,T> assignment, T value, Set<T> reason)` sets value's explanation
    `void` | `setNoGood(T value, Set<T> noGood)`
    `void` | `setNoGood(V variable, Set<T>[] noGood)`
    `Set<T>` | `supports(Assignment<V,T> assignment, Constraint<V,T> constraint, T value, V 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)

  - ### 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)

    - #### goodValues

          public Set<T> goodValues(V variable)

      good values of a variable (values not removed from variables domain)
      Parameters:
        `variable` - given variable
      Returns:
        good values for the variable (i.e., values from the domain of the variable that have no no-good set)

    - #### noGood

          public Set<T> noGood(T value)

      variables explanation
      Parameters:
        `value` - given value
      Returns:
        no-good set for the value

    - #### isGood

          public boolean isGood(T value)

      is variable good
      Parameters:
        `value` - given value
      Returns:
        true if good, i.e., the value has no no-good set

    - #### setGood

          protected void setGood(T value)

      sets value to be good
      Parameters:
        `value` - given value

    - #### propagate

          public void propagate(Assignment<V,T> assignment,
                                List<T> queue)

    - #### propagate

          public void propagate(Assignment<V,T> assignment,
                                Constraint<V,T> constraint,
                                T noGoodValue,
                                List<T> queue)

    - #### revise

          public boolean revise(Assignment<V,T> assignment,
                                T value)

    - #### revise

          public boolean revise(Assignment<V,T> assignment,
                                Constraint<V,T> constraint,
                                T value)

    - #### explanation

          public Set<T> explanation(Assignment<V,T> assignment,
                                    Constraint<V,T> constraint,
                                    T value,
                                    V variable)

    - #### supports

          public Set<T> supports(Assignment<V,T> assignment,
                                 Constraint<V,T> constraint,
                                 T value,
                                 V variable)

    - #### hasSupport

          public boolean hasSupport(Assignment<V,T> assignment,
                                    Constraint<V,T> constraint,
                                    T value,
                                    V variable)

    - #### setNoGood

          public void setNoGood(Assignment<V,T> assignment,
                                T value,
                                Set<T> reason)

      sets value's explanation
      Parameters:
        `assignment` - current assignment
        `value` - a value
        `reason` - no-good set for the value