org.cpsolver.studentsct.online.selection

## Class SuggestionSelection

- java.lang.Object
- - org.cpsolver.studentsct.heuristics.selection.BranchBoundSelection
  - - org.cpsolver.studentsct.online.selection.SuggestionSelection

- All Implemented Interfaces:
    NeighbourSelection<Request,Enrollment>, InfoProvider<Request,Enrollment>, SolverListener<Request,Enrollment>, OnlineSectioningSelection

      public class SuggestionSelection
      extends BranchBoundSelection
      implements OnlineSectioningSelection

  Online student sectioning algorithm based on the `BranchBoundSelection` of the batch solver. The selections adds the ability to provide required free times and sections and to prefer certain sections. If a course request has preferred sections, StudentWeights.PreferenceFactor parameter is used to penalize selection of a non-preferred section.
  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.
  Author:
    Tomáš Müller

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `SuggestionSelection.Selection` Extension of `BranchBoundSelection.Selection` including checking of required free times and sections.

    - ### Nested classes/interfaces inherited from class org.cpsolver.studentsct.heuristics.selection.BranchBoundSelection

      `BranchBoundSelection.BranchBoundNeighbour`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Hashtable<CourseRequest,Set<Section>>` | `iPreferredSections`
    `protected Hashtable<CourseRequest,Config>` | `iRequiredConfig`
    `protected Set<FreeTimeRequest>` | `iRequiredFreeTimes`
    `protected Hashtable<CourseRequest,Hashtable<Subpart,Section>>` | `iRequiredSection`
    `protected Set<CourseRequest>` | `iRequiredUnassinged`

    - ### Fields inherited from class org.cpsolver.studentsct.heuristics.selection.BranchBoundSelection

      `iBranchWhenSelectedHasNoConflict, iDistanceConflict, iDistConfWeight, iFilter, iMinimizePenalty, iModel, iNbrIterations, iNbrNoSolution, iNbrTimeoutReached, iOrder, iStudentQuality, iStudents, iTimeout, iTimeOverlaps, iTimesToAvoidHeuristics, iTotalTime, sDebug`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SuggestionSelection(DataProperties properties)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BranchBoundSelection.BranchBoundNeighbour` | `select(Assignment<Request,Enrollment> assignment, Student student)` Compute student schedule
    `void` | `setMaxOverExpected(double maxOverExpected)` Set hard limit on the `OverExpectedCriterion` penalty.
    `void` | `setModel(OnlineSectioningModel model)` Set online sectioning model
    `void` | `setPreferredSections(Hashtable<CourseRequest,Set<Section>> preferredSections)` Set preferred sections
    `void` | `setRequiredFreeTimes(Set<FreeTimeRequest> requiredFreeTimes)` Set required free times
    `void` | `setRequiredSections(Hashtable<CourseRequest,Set<Section>> requiredSections)` Set required sections
    `void` | `setRequiredUnassinged(Set<CourseRequest> requiredUnassignedRequests)` Set course requests that are to be left unassigned

    - ### Methods inherited from class org.cpsolver.studentsct.heuristics.selection.BranchBoundSelection

      `addStudent, getFilter, getInfo, getInfo, getSelection, init, init, neighbourFailed, neighbourSelected, nextStudent, selectNeighbour, setModel, valueSelected, variableSelected, withFilter`

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

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

- - ### Field Detail

    - #### iRequiredFreeTimes

          protected Set<FreeTimeRequest> iRequiredFreeTimes

    - #### iRequiredConfig

          protected Hashtable<CourseRequest,Config> iRequiredConfig

    - #### iRequiredSection

          protected Hashtable<CourseRequest,Hashtable<Subpart,Section>> iRequiredSection

    - #### iPreferredSections

          protected Hashtable<CourseRequest,Set<Section>> iPreferredSections

    - #### iRequiredUnassinged

          protected Set<CourseRequest> iRequiredUnassinged

  - ### Constructor Detail

    - #### SuggestionSelection

          public SuggestionSelection(DataProperties properties)

  - ### Method Detail

    - #### setPreferredSections

          public void setPreferredSections(Hashtable<CourseRequest,Set<Section>> preferredSections)

      Description copied from interface: `OnlineSectioningSelection`
      Set preferred sections
      Specified by:
        `setPreferredSections` in interface `OnlineSectioningSelection`
      Parameters:
        `preferredSections` - preferred sections for each course request

    - #### setRequiredSections

          public void setRequiredSections(Hashtable<CourseRequest,Set<Section>> requiredSections)

      Description copied from interface: `OnlineSectioningSelection`
      Set required sections
      Specified by:
        `setRequiredSections` in interface `OnlineSectioningSelection`
      Parameters:
        `requiredSections` - required sections for each course request

    - #### setRequiredFreeTimes

          public void setRequiredFreeTimes(Set<FreeTimeRequest> requiredFreeTimes)

      Description copied from interface: `OnlineSectioningSelection`
      Set required free times
      Specified by:
        `setRequiredFreeTimes` in interface `OnlineSectioningSelection`
      Parameters:
        `requiredFreeTimes` - required free times

    - #### select

          public BranchBoundSelection.BranchBoundNeighbour select(Assignment<Request,Enrollment> assignment,
                                                                  Student student)

      Description copied from interface: `OnlineSectioningSelection`
      Compute student schedule
      Specified by:
        `select` in interface `OnlineSectioningSelection`
      Parameters:
        `assignment` - current assignment
        `student` - student in question
      Returns:
        student schedule

    - #### setModel

          public void setModel(OnlineSectioningModel model)

      Description copied from interface: `OnlineSectioningSelection`
      Set online sectioning model
      Specified by:
        `setModel` in interface `OnlineSectioningSelection`
      Parameters:
        `model` - online sectioning model

    - #### setRequiredUnassinged

          public void setRequiredUnassinged(Set<CourseRequest> requiredUnassignedRequests)

      Description copied from interface: `OnlineSectioningSelection`
      Set course requests that are to be left unassigned
      Specified by:
        `setRequiredUnassinged` in interface `OnlineSectioningSelection`
      Parameters:
        `requiredUnassignedRequests` - course requests that are required to be left unassigned

    - #### setMaxOverExpected

          public void setMaxOverExpected(double maxOverExpected)

      Description copied from interface: `OnlineSectioningSelection`
      Set hard limit on the `OverExpectedCriterion` penalty.
      Specified by:
        `setMaxOverExpected` in interface `OnlineSectioningSelection`
      Parameters:
        `maxOverExpected` - max over-expected limit