org.cpsolver.ifs.algorithms

## Class GreatDeluge.GreatDelugeContext

- java.lang.Object
- - org.cpsolver.ifs.algorithms.NeighbourSearch.NeighbourSearchContext
  - - org.cpsolver.ifs.algorithms.GreatDeluge.GreatDelugeContext

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

      public class GreatDeluge.GreatDelugeContext
      extends NeighbourSearch.NeighbourSearchContext

- - ### Field Summary

    - ### Fields inherited from class org.cpsolver.ifs.algorithms.NeighbourSearch.NeighbourSearchContext

      `iIter, iT0`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GreatDelugeContext()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `accept(Assignment<V,T> assignment, Model<V,T> model, Neighbour<V,T> neighbour, double value, boolean lazy)` Accept the given neighbour if it does not worsen the current solution or when the new solution is below the bound
    `protected void` | `activate(Solution<V,T> solution)` Setup the bound
    `void` | `bestSaved(Solution<V,T> solution)` Update last improving iteration count
    `protected double` | `getCoolRate(int idx)`
    `protected void` | `incIteration(Solution<V,T> solution)` Increment iteration count, update bound

    - ### Methods inherited from class org.cpsolver.ifs.algorithms.NeighbourSearch.NeighbourSearchContext

      `bestCleared, bestRestored, canContinue, deactivate, getInfo, getInfo, getTimeMillis, solutionUpdated`

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

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

- - ### Constructor Detail

    - #### GreatDelugeContext

          public GreatDelugeContext()

  - ### Method Detail

    - #### accept

          protected boolean accept(Assignment<V,T> assignment,
                                   Model<V,T> model,
                                   Neighbour<V,T> neighbour,
                                   double value,
                                   boolean lazy)

      Accept the given neighbour if it does not worsen the current solution or when the new solution is below the bound
      Specified by:
        `accept` in class `NeighbourSearch.NeighbourSearchContext`
      Parameters:
        `assignment` - current assignment
        `model` - problem model
        `neighbour` - a generated move
        `value` - value of the generated move (i.e., its impact on the solution value)
        `lazy` - true if lazy move
      Returns:
        true if the generated move is to be assigned

    - #### activate

          protected void activate(Solution<V,T> solution)

      Setup the bound
      Overrides:
        `activate` in class `NeighbourSearch.NeighbourSearchContext`
      Parameters:
        `solution` - current solution

    - #### getCoolRate

          protected double getCoolRate(int idx)

    - #### incIteration

          protected void incIteration(Solution<V,T> solution)

      Increment iteration count, update bound
      Overrides:
        `incIteration` in class `NeighbourSearch.NeighbourSearchContext`
      Parameters:
        `solution` - current solution

    - #### bestSaved

          public void bestSaved(Solution<V,T> solution)

      Update last improving iteration count
      Specified by:
        `bestSaved` in interface `SolutionListener<V extends Variable<V,T>,T extends Value<V,T>>`
      Overrides:
        `bestSaved` in class `NeighbourSearch.NeighbourSearchContext`
      Parameters:
        `solution` - source solution