org.cpsolver.ifs.algorithms.neighbourhoods

## Class RandomSwapMove.SwapNeighbour

- java.lang.Object
- - org.cpsolver.ifs.algorithms.neighbourhoods.RandomSwapMove.SwapNeighbour

- All Implemented Interfaces:
    Neighbour<V,T>
  Enclosing class:
    RandomSwapMove<V extends Variable<V,T>,T extends Value<V,T>>

      public class RandomSwapMove.SwapNeighbour
      extends Object
      implements Neighbour<V,T>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SwapNeighbour(Collection<T> assignments, double value)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assign(Assignment<V,T> assignment, long iteration)` Perform assignment
    `Map<V,T>` | `assignments()` Return assignments to be done.
    `String` | `toString()`
    `double` | `value(Assignment<V,T> assignment)` Difference in the evaluation function, if this neighnour is assigned.

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

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

- - ### Constructor Detail

    - #### SwapNeighbour

          public SwapNeighbour(Collection<T> assignments,
                               double value)

  - ### Method Detail

    - #### value

          public double value(Assignment<V,T> assignment)

      Description copied from interface: `Neighbour`
      Difference in the evaluation function, if this neighnour is assigned.
      Specified by:
        `value` in interface `Neighbour<V extends Variable<V,T>,T extends Value<V,T>>`
      Parameters:
        `assignment` - current assignment
      Returns:
        difference in the solution value when assigned

    - #### assign

          public void assign(Assignment<V,T> assignment,
                             long iteration)

      Description copied from interface: `Neighbour`
      Perform assignment
      Specified by:
        `assign` in interface `Neighbour<V extends Variable<V,T>,T extends Value<V,T>>`
      Parameters:
        `assignment` - current assignment
        `iteration` - current iteration

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### assignments

          public Map<V,T> assignments()

      Description copied from interface: `Neighbour`
      Return assignments to be done.
      Specified by:
        `assignments` in interface `Neighbour<V extends Variable<V,T>,T extends Value<V,T>>`
      Returns:
        list of assignments (including unassignments) of this neighbour