org.cpsolver.studentsct.heuristics.selection

## Class RandomUnassignmentSelection.UnassignStudentNeighbour

- java.lang.Object
- - org.cpsolver.studentsct.heuristics.selection.RandomUnassignmentSelection.UnassignStudentNeighbour

- All Implemented Interfaces:
    Neighbour<Request,Enrollment>
  Enclosing class:
    RandomUnassignmentSelection

      public static class RandomUnassignmentSelection.UnassignStudentNeighbour
      extends Object
      implements Neighbour<Request,Enrollment>

  Unassignment of all requests of a student

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnassignStudentNeighbour(Student student, Assignment<Request,Enrollment> assignment, Request.RequestPriority priority)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assign(Assignment<Request,Enrollment> assignment, long iteration)` All requests of the given student are unassigned
    `Map<Request,Enrollment>` | `assignments()` Return assignments to be done.
    `boolean` | `canUnassign(Enrollment enrollment)` Check if the given enrollment can be unassigned
    `String` | `toString()`
    `double` | `value(Assignment<Request,Enrollment> assignment)` Difference in the evaluation function, if this neighnour is assigned.

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

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

- - ### Constructor Detail

    - #### UnassignStudentNeighbour

          public UnassignStudentNeighbour(Student student,
                                          Assignment<Request,Enrollment> assignment,
                                          Request.RequestPriority priority)

      Constructor
      Parameters:
        `student` - a student to be unassigned

  - ### Method Detail

    - #### canUnassign

          public boolean canUnassign(Enrollment enrollment)

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

    - #### value

          public double value(Assignment<Request,Enrollment> assignment)

      Description copied from interface: `Neighbour`
      Difference in the evaluation function, if this neighnour is assigned.
      Specified by:
        `value` in interface `Neighbour<Request,Enrollment>`
      Parameters:
        `assignment` - current assignment
      Returns:
        difference in the solution value when assigned

    - #### assign

          public void assign(Assignment<Request,Enrollment> assignment,
                             long iteration)

      All requests of the given student are unassigned
      Specified by:
        `assign` in interface `Neighbour<Request,Enrollment>`
      Parameters:
        `assignment` - current assignment
        `iteration` - current iteration

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### assignments

          public Map<Request,Enrollment> assignments()

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