org.cpsolver.exam.split

## Class ExamSplitMoves.ExamShuffleNeighbour

- java.lang.Object
- - org.cpsolver.exam.split.ExamSplitMoves.ExamShuffleNeighbour

- All Implemented Interfaces:
    Neighbour<Exam,ExamPlacement>
  Enclosing class:
    ExamSplitMoves

      protected class ExamSplitMoves.ExamShuffleNeighbour
      extends Object
      implements Neighbour<Exam,ExamPlacement>

  Shuffle students between the parent exam and all of its children. Only swaps that are decreasing the weighted sum of student conflicts are considered.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExamShuffleNeighbour(Assignment<Exam,ExamPlacement> assignment, Exam exam)` Exam to be shuffled.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assign(Assignment<Exam,ExamPlacement> assignment, long iteration)` Perform the shuffle.
    `Map<Exam,ExamPlacement>` | `assignments()` Return assignments to be done.
    `Exam` | `exam()` Exam to be shuffled.
    `double` | `value(Assignment<Exam,ExamPlacement> assignment)` Value of the shuffle.

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

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

- - ### Constructor Detail

    - #### ExamShuffleNeighbour

          public ExamShuffleNeighbour(Assignment<Exam,ExamPlacement> assignment,
                                      Exam exam)

      Exam to be shuffled.
      Parameters:
        `assignment` - current exam
        `exam` - child exam to be shuffled

  - ### Method Detail

    - #### assign

          public void assign(Assignment<Exam,ExamPlacement> assignment,
                             long iteration)

      Perform the shuffle.
      Specified by:
        `assign` in interface `Neighbour<Exam,ExamPlacement>`
      Parameters:
        `assignment` - current assignment
        `iteration` - current iteration

    - #### value

          public double value(Assignment<Exam,ExamPlacement> assignment)

      Value of the shuffle. This is the weighted sum of all student conflicts that will be removed by the shuffle.
      Specified by:
        `value` in interface `Neighbour<Exam,ExamPlacement>`
      Parameters:
        `assignment` - current assignment
      Returns:
        difference in the solution value when assigned

    - #### exam

          public Exam exam()

      Exam to be shuffled.
      Returns:
        exam to be shuffled

    - #### assignments

          public Map<Exam,ExamPlacement> assignments()

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