org.cpsolver.studentsct.heuristics.selection

## Class SwapStudentSelection.SwapStudentNeighbour

- java.lang.Object
- - org.cpsolver.studentsct.heuristics.selection.SwapStudentSelection.SwapStudentNeighbour

- All Implemented Interfaces:
    Neighbour<Request,Enrollment>
  Enclosing class:
    SwapStudentSelection

      public static class SwapStudentSelection.SwapStudentNeighbour
      extends Object
      implements Neighbour<Request,Enrollment>

  Neighbour that contains the swap

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SwapStudentNeighbour(double value, Enrollment enrollment, List<Enrollment> swaps)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assign(Assignment<Request,Enrollment> assignment, long iteration)` Perform the move.
    `Map<Request,Enrollment>` | `assignments()` Return assignments to be done.
    `Student` | `getStudent()`
    `String` | `toString()`
    `double` | `value(Assignment<Request,Enrollment> 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

    - #### SwapStudentNeighbour

          public SwapStudentNeighbour(double value,
                                      Enrollment enrollment,
                                      List<Enrollment> swaps)

      Constructor
      Parameters:
        `value` - cost of the move
        `enrollment` - the enrollment which is to be assigned to the given student
        `swaps` - enrollment swaps

  - ### Method Detail

    - #### value

          public double value(Assignment<Request,Enrollment> assignment)

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

    - #### getStudent

          public Student getStudent()

    - #### assign

          public void assign(Assignment<Request,Enrollment> assignment,
                             long iteration)

      Perform the move. All the requeired swaps are identified and performed as well.
      Specified by:
        `assign` in interface `Neighbour<Request,Enrollment>`
      Parameters:
        `assignment` - current assignment
        `iteration` - current iteration

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### assignments

          public Map<Request,Enrollment> assignments()

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