org.cpsolver.exam.split

## Class ExamSplitMoves.ExamMergeNeighbour

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

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

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

  Merge two exams that have been split before back into one. This moves the students from the child exam back to its parent and removes the child exam from the problem.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExamMergeNeighbour(Assignment<Exam,ExamPlacement> assignment, Exam exam)` Child exam to be removed.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assign(Assignment<Exam,ExamPlacement> assignment, long iteration)` Perform the merge.
    `Map<Exam,ExamPlacement>` | `assignments()` Return assignments to be done.
    `Exam` | `exam()` Exam to be merged.
    `int` | `nrStudents()` Number of students that will be moved back to the parent exam or to some other child (if there are any).
    `double` | `value(Assignment<Exam,ExamPlacement> assignment)` Value of the merge.

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

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

- - ### Constructor Detail

    - #### ExamMergeNeighbour

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

      Child exam to be removed.
      Parameters:
        `assignment` - current assignment
        `exam` - child exam to be merged back

  - ### Method Detail

    - #### assign

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

      Perform the merge.
      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 merge. This is the weighted sum of all student conflicts that will be added by the merge, minus the weight of the splitter criterion.
      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 back to the parent exam or to some other child (if there are any).
      Returns:
        number of students

    - #### exam

          public Exam exam()

      Exam to be merged.
      Returns:
        exam to be merged

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