org.cpsolver.studentsct.online.selection

## Class ResectioningWeights

- java.lang.Object
- - org.cpsolver.studentsct.online.selection.StudentSchedulingAssistantWeights
  - - org.cpsolver.studentsct.online.selection.ResectioningWeights

- All Implemented Interfaces:
    SolutionComparator<Request,Enrollment>, StudentWeights

      public class ResectioningWeights
      extends StudentSchedulingAssistantWeights

  Re-scheduling variant of `StudentWeights` model. It is based on the `StudentSchedulingAssistantWeights`. This model is used when a single course of a student is rescheduled. Following criteria are included:
  - StudentWeights.SameChoiceFactor .. penalization of selecting a different choice (see `Choice`)
  - StudentWeights.SameRoomsFactor .. penalization of selecting different room
  - StudentWeights.SameTimeFactor .. penalization of selecting different time
  - StudentWeights.SameNameFactor .. penalization of selecting different section (section name / external id does not match)
  Version:
    StudentSct 1.3 (Student Sectioning)
    Copyright (C) 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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `ResectioningWeights.LastSectionProvider` Compare the old assignment with the current one

    - ### Nested classes/interfaces inherited from interface org.cpsolver.studentsct.weights.StudentWeights

      `StudentWeights.Implementation`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResectioningWeights(DataProperties properties)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getWeight(Assignment<Request,Enrollment> assignment, Enrollment enrollment)` Return base weight of the given enrollment
    `static boolean` | `isSame(Enrollment e1, Enrollment e2)`
    `static boolean` | `sameChoice(Section section, Choice choice)`
    `static boolean` | `sameName(Long courseId, Section s1, Section s2)`
    `static boolean` | `sameRooms(Section s, List<RoomLocation> rooms)`
    `static boolean` | `sameTime(Section s, TimeLocation t)`
    `void` | `setLastSectionProvider(ResectioningWeights.LastSectionProvider lastSectionProvider)`

    - ### Methods inherited from class org.cpsolver.studentsct.online.selection.StudentSchedulingAssistantWeights

      `clearBestCache, getBaseWeight, getBound, getDistanceConflictWeight, getStudentQualityConflictWeight, getTimeOverlapConflictWeight, getWeight, getWeight, isBetterThanBestSolution, isFreeTimeAllowOverlaps, round`

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

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

- - ### Constructor Detail

    - #### ResectioningWeights

          public ResectioningWeights(DataProperties properties)

  - ### Method Detail

    - #### setLastSectionProvider

          public void setLastSectionProvider(ResectioningWeights.LastSectionProvider lastSectionProvider)

    - #### getWeight

          public double getWeight(Assignment<Request,Enrollment> assignment,
                                  Enrollment enrollment)

      Description copied from interface: `StudentWeights`
      Return base weight of the given enrollment
      Specified by:
        `getWeight` in interface `StudentWeights`
      Overrides:
        `getWeight` in class `StudentSchedulingAssistantWeights`
      Parameters:
        `assignment` - current assignment
        `enrollment` - given enrollment
      Returns:
        weight (higher weight means better value)

    - #### isSame

          public static boolean isSame(Enrollment e1,
                                       Enrollment e2)

    - #### sameRooms

          public static boolean sameRooms(Section s,
                                          List<RoomLocation> rooms)

    - #### sameTime

          public static boolean sameTime(Section s,
                                         TimeLocation t)

    - #### sameName

          public static boolean sameName(Long courseId,
                                         Section s1,
                                         Section s2)

    - #### sameChoice

          public static boolean sameChoice(Section section,
                                           Choice choice)