net.sf.cpsolver.ifs.model

## Class SimpleNeighbour<V extends Variable<V,T>,T extends Value<V,T>>

- java.lang.Object
- - net.sf.cpsolver.ifs.model.Neighbour<V,T>
  - - net.sf.cpsolver.ifs.model.SimpleNeighbour<V,T>

- Direct Known Subclasses:
    ExamSimpleNeighbour

      public class SimpleNeighbour<V extends Variable<V,T>,T extends Value<V,T>>
      extends Neighbour<V,T>

  A neighbour consisting of a change (either assignment or unassignment) of a single variable.
  Version:
    IFS 1.2 (Iterative Forward Search)
    Copyright (C) 2006 - 2010 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.
  See Also:
    `NeighbourSelection`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleNeighbour(V variable, T value)` Model

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assign(long iteration)` Perform assignment
    `T` | `getValue()` Selected value
    `V` | `getVariable()` Selected variable
    `String` | `toString()`
    `double` | `value()` Improvement in the solution value if this neighbour is accepted.

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

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

- - ### Constructor Detail

    - #### SimpleNeighbour

          public SimpleNeighbour(V variable,
                                 T value)

      Model
      Parameters:
        `variable` - variable to be assigned
        `value` - value to be assigned to the given variable, null if the variable should be unassigned

  - ### Method Detail

    - #### getVariable

          public V getVariable()

      Selected variable

    - #### getValue

          public T getValue()

      Selected value

    - #### assign

          public void assign(long iteration)

      Perform assignment
      Specified by:
        `assign` in class `Neighbour<V extends Variable<V,T>,T extends Value<V,T>>`

    - #### value

          public double value()

      Improvement in the solution value if this neighbour is accepted.
      Specified by:
        `value` in class `Neighbour<V extends Variable<V,T>,T extends Value<V,T>>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`