org.cpsolver.studentsct.heuristics.selection

## Class SwapStudentSelection.Selection

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

- Enclosing class:
    SwapStudentSelection

      public class SwapStudentSelection.Selection
      extends Object

  This class looks for a possible swap move for the given student

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Selection(Student student, Assignment<Request,Enrollment> assignment)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canUnassign(Enrollment enrollment, Enrollment conflict, Assignment<Request,Enrollment> assignment)` Check if the given conflicting enrollment can be unassigned
    `Enrollment` | `getBestEnrollment()` The best enrollment found.
    `double` | `getBestValue()` Cost of the best enrollment found
    `Set<Student>` | `getProblemStudents()` Set of problematic students computed in the last selection
    `long` | `getTime()` Time spent in the last selection
    `boolean` | `isTimeoutReached()` Was timeout reached during the selection
    `SwapStudentSelection.SwapStudentNeighbour` | `select()` The actual selection

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

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

- - ### Constructor Detail

    - #### Selection

          public Selection(Student student,
                           Assignment<Request,Enrollment> assignment)

      Constructor
      Parameters:
        `assignment` - current assignment
        `student` - given student

  - ### Method Detail

    - #### canUnassign

          public boolean canUnassign(Enrollment enrollment,
                                     Enrollment conflict,
                                     Assignment<Request,Enrollment> assignment)

      Check if the given conflicting enrollment can be unassigned
      Parameters:
        `conflict` - given enrollment
      Returns:
        if running MPP, do not unassign initial enrollments

    - #### select

          public SwapStudentSelection.SwapStudentNeighbour select()

      The actual selection
      Returns:
        student swap neighbour

    - #### isTimeoutReached

          public boolean isTimeoutReached()

      Was timeout reached during the selection
      Returns:
        was timeout reached

    - #### getTime

          public long getTime()

      Time spent in the last selection
      Returns:
        search time

    - #### getBestEnrollment

          public Enrollment getBestEnrollment()

      The best enrollment found.
      Returns:
        best enrollment

    - #### getBestValue

          public double getBestValue()

      Cost of the best enrollment found
      Returns:
        best value

    - #### getProblemStudents

          public Set<Student> getProblemStudents()

      Set of problematic students computed in the last selection
      Returns:
        identified problematic students