org.cpsolver.exam.split

## Class ExamSplitMoves

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

- All Implemented Interfaces:
    NeighbourSelection<Exam,ExamPlacement>

      public class ExamSplitMoves
      extends Object
      implements NeighbourSelection<Exam,ExamPlacement>

  Experimental neighbor selection that allows an exam to be split into two if it decreases the number of student conflicts.
  An examination split is improving (and is considered) if the weighted number of student conflicts that will be removed by the split is bigger than the weight of the splitter criterion `AbstractCriterion.getWeight()`.
  Version:
    ExamTT 1.3 (Examination Timetabling)
    Copyright (C) 2008 - 2014 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/.
  Author:
    Tomáš Müller

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `ExamSplitMoves.ExamMergeNeighbour` Merge two exams that have been split before back into one.
    `protected class` | `ExamSplitMoves.ExamShuffleNeighbour` Shuffle students between the parent exam and all of its children.
    `protected class` | `ExamSplitMoves.ExamSplitNeighbour` Split an exam into two

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExamSplitMoves(DataProperties properties)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ExamSplitMoves.ExamSplitNeighbour` | `bestSplit(Assignment<Exam,ExamPlacement> assignment, Exam exam)` Find a best split for the given exam.
    `Set<ExamRoomPlacement>` | `findBestAvailableRooms(Assignment<Exam,ExamPlacement> assignment, Exam exam, ExamPeriodPlacement period, int examSize)` Find best available rooms for a new exam (that is to be split from the given one), if is is assigned into the given examination period.
    `void` | `init(Solver<Exam,ExamPlacement> solver)` Initialization
    `Neighbour<Exam,ExamPlacement>` | `selectNeighbour(Solution<Exam,ExamPlacement> solution)` Select a split (split an exam into two), a merge (merge two split exams back together) or shuffle operation (move students between two exams that has been split before).

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

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

- - ### Constructor Detail

    - #### ExamSplitMoves

          public ExamSplitMoves(DataProperties properties)

      Constructor
      Parameters:
        `properties` - solver configuration

  - ### Method Detail

    - #### init

          public void init(Solver<Exam,ExamPlacement> solver)

      Initialization
      Specified by:
        `init` in interface `NeighbourSelection<Exam,ExamPlacement>`
      Parameters:
        `solver` - current solver

    - #### findBestAvailableRooms

          public Set<ExamRoomPlacement> findBestAvailableRooms(Assignment<Exam,ExamPlacement> assignment,
                                                               Exam exam,
                                                               ExamPeriodPlacement period,
                                                               int examSize)

      Find best available rooms for a new exam (that is to be split from the given one), if is is assigned into the given examination period.
      Parameters:
        `assignment` - current assignment
        `exam` - an exam to be split
        `period` - a period to be assigned to the new exam
        `examSize` - size of the new exam (i.e., the number of students that will be moved from the given exam to the new one)
      Returns:
        best room placement for the given exam and period

    - #### bestSplit

          public ExamSplitMoves.ExamSplitNeighbour bestSplit(Assignment<Exam,ExamPlacement> assignment,
                                                             Exam exam)

      Find a best split for the given exam. Only improving neighbors are considered.
      Parameters:
        `assignment` - current assignment
        `exam` - an exam to be split
      Returns:
        best neighbor that will do the split

    - #### selectNeighbour

          public Neighbour<Exam,ExamPlacement> selectNeighbour(Solution<Exam,ExamPlacement> solution)

      Select a split (split an exam into two), a merge (merge two split exams back together) or shuffle operation (move students between two exams that has been split before).
      Specified by:
        `selectNeighbour` in interface `NeighbourSelection<Exam,ExamPlacement>`
      Parameters:
        `solution` - given solution
      Returns:
        a neighbour assignment