org.cpsolver.studentsct.online.selection

## Class SuggestionSelection.Selection

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

- Enclosing class:
    SuggestionSelection

      public class SuggestionSelection.Selection
      extends BranchBoundSelection.Selection

  Extension of `BranchBoundSelection.Selection` including checking of required free times and sections.

- - ### Field Summary

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

      `iAssignment, iBestAssignment, iBestValue, iCurrentAssignment, iStudent, iT0, iT1, iTimeoutReached, iTimesToAvoid, iValues`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `canLeaveUnassigned(Request request)` Returns true if the given request can be left unassigned
    `Enrollment` | `firstConflict(int idx, Enrollment enrollment)` First conflicting enrollment
    `protected double` | `getBound(Request r)` Return bound of a request
    `protected double` | `getWeight(Enrollment enrollment, Set<DistanceConflict.Conflict> distanceConflicts, Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts)` Deprecated.
    `boolean` | `inConflict(int idx, Enrollment enrollment)` True if the enrollment is conflicting
    `boolean` | `isAllowed(int idx, Enrollment enrollment)` Check if the given enrollment is allowed
    `protected List<Enrollment>` | `values(CourseRequest request)` Returns list of available enrollments for a course request

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

      `backTrack, canAssign, getAssignmentPenalty, getBestAssignment, getBestNrAssigned, getBestValue, getBound, getDistanceConflicts, getNrAssigned, getNrAssignedBound, getPenalty, getPenaltyBound, getStudentQualityConflicts, getTime, getTimeOverlappingConflicts, getValue, getWeight, isTimeoutReached, saveBest, select`

    - ### 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)

  - ### Method Detail

    - #### isAllowed

          public boolean isAllowed(int idx,
                                   Enrollment enrollment)

      Check if the given enrollment is allowed
      Parameters:
        `idx` - enrollment index
        `enrollment` - enrollment
      Returns:
        true if allowed (there is no conflict with required sections or free times)

    - #### inConflict

          public boolean inConflict(int idx,
                                    Enrollment enrollment)

      Description copied from class: `BranchBoundSelection.Selection`
      True if the enrollment is conflicting
      Overrides:
        `inConflict` in class `BranchBoundSelection.Selection`
      Parameters:
        `idx` - index of request
        `enrollment` - enrollment in question
      Returns:
        true if there is a conflict with previous enrollments

    - #### firstConflict

          public Enrollment firstConflict(int idx,
                                          Enrollment enrollment)

      Description copied from class: `BranchBoundSelection.Selection`
      First conflicting enrollment
      Overrides:
        `firstConflict` in class `BranchBoundSelection.Selection`
      Parameters:
        `idx` - index of request
        `enrollment` - enrollment in question
      Returns:
        first conflicting enrollment

    - #### canLeaveUnassigned

          protected boolean canLeaveUnassigned(Request request)

      Description copied from class: `BranchBoundSelection.Selection`
      Returns true if the given request can be left unassigned
      Overrides:
        `canLeaveUnassigned` in class `BranchBoundSelection.Selection`
      Parameters:
        `request` - given request
      Returns:
        true if can be left unassigned

    - #### values

          protected List<Enrollment> values(CourseRequest request)

      Description copied from class: `BranchBoundSelection.Selection`
      Returns list of available enrollments for a course request
      Overrides:
        `values` in class `BranchBoundSelection.Selection`
      Parameters:
        `request` - given request
      Returns:
        list of enrollments to consider

    - #### getWeight

          @Deprecated
          protected double getWeight(Enrollment enrollment,
                                                 Set<DistanceConflict.Conflict> distanceConflicts,
                                                 Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts)

      Deprecated.
      Description copied from class: `BranchBoundSelection.Selection`
      Weight of an assignment. Unlike `StudentWeights.getWeight(Assignment, Enrollment, Set, Set)`, only count this side of distance conflicts and time overlaps.
      Overrides:
        `getWeight` in class `BranchBoundSelection.Selection`
      Parameters:
        `enrollment` - an enrollment
        `distanceConflicts` - set of distance conflicts
        `timeOverlappingConflicts` - set of time overlapping conflicts
      Returns:
        value of the assignment

    - #### getBound

          protected double getBound(Request r)

      Description copied from class: `BranchBoundSelection.Selection`
      Return bound of a request
      Overrides:
        `getBound` in class `BranchBoundSelection.Selection`
      Parameters:
        `r` - a request
      Returns:
        bound