org.cpsolver.exam.split

## Class ExamSplitMoves.ExamSplitNeighbour

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

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

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

  Split an exam into two

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExamSplitNeighbour(Assignment<Exam,ExamPlacement> assignment, Exam exam, ExamPlacement placement)` Split an exam into two, assign the new exam into the given placement.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assign(Assignment<Exam,ExamPlacement> assignment, long iteration)` Perform the split.
    `Map<Exam,ExamPlacement>` | `assignments()` Return assignments to be done.
    `Exam` | `exam()` Exam to be split.
    `int` | `nrStudents()` Number of students that will be moved into the new exam.
    `ExamPlacement` | `placement()` Placement of the new exam.
    `double` | `value(Assignment<Exam,ExamPlacement> assignment)` Value of the split.

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

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

- - ### Constructor Detail

    - #### ExamSplitNeighbour

          public ExamSplitNeighbour(Assignment<Exam,ExamPlacement> assignment,
                                    Exam exam,
                                    ExamPlacement placement)

      Split an exam into two, assign the new exam into the given placement.
      Parameters:
        `assignment` - current assignment
        `exam` - an exam to be split
        `placement` - a placement to be assigned to the new exam

  - ### Method Detail

    - #### assign

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

      Perform the split.
      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 split. This is the weight of the splitter criterion minus the weighted sum of all student conflicts that will be removed by the split.
      Specified by:
        `value` in interface `Neighbour<Exam,ExamPlacement>`
      Parameters:
        `assignment` - current assignment
      Returns:
        difference in the solution value when assigned

    - #### nrStudents

          public int nrStudents()

      Number of students that will be moved into the new exam.
      Returns:
        number of students

    - #### exam

          public Exam exam()

      Exam to be split.
      Returns:
        exam to be split

    - #### placement

          public ExamPlacement placement()

      Placement of the new exam.
      Returns:
        placement of the new exam

    - #### 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