org.cpsolver.studentsct.reservation

## Class CurriculumReservation

- java.lang.Object
- - org.cpsolver.ifs.assignment.context.AbstractClassWithContext<Request,Enrollment,Reservation.ReservationContext>
  - - org.cpsolver.studentsct.reservation.Reservation
    - - org.cpsolver.studentsct.reservation.CurriculumReservation

- All Implemented Interfaces:
    Comparable<Reservation>, AssignmentComparable<Reservation,Request,Enrollment>, CanHoldContext, CanInheritContext<Request,Enrollment,Reservation.ReservationContext>, HasAssignmentContext<Request,Enrollment,Reservation.ReservationContext>
  Direct Known Subclasses:
    CurriculumOverride

      public class CurriculumReservation
      extends Reservation

  Curriculum reservation. Students are matched based on their academic area. If classifications and/or majors are included, student must match on them as well.
  Version:
    StudentSct 1.3 (Student Sectioning)
    Copyright (C) 2007 - 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/interfaces inherited from class org.cpsolver.studentsct.reservation.Reservation

      `Reservation.ReservationContext`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `DEFAULT_ALLOW_OVERLAP` Overlaps are not allowed for curriculum reservations.
    `static boolean` | `DEFAULT_CAN_ASSIGN_OVER_LIMIT` Curriculum reservations can not assign over the limit.
    `static boolean` | `DEFAULT_MUST_BE_USED` Curriculum reservation does not need to be used
    `static int` | `DEFAULT_PRIORITY` Reservation priority (lower than individual and group reservations)

    - ### Fields inherited from interface org.cpsolver.ifs.assignment.context.CanHoldContext

      `sMaxSize`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `CurriculumReservation(long id, double limit, Offering offering, Collection<String> acadAreas, Collection<String> classifications, Collection<String> majors, Collection<String> minors)` Constructor
    `protected` | `CurriculumReservation(long id, double limit, Offering offering, Collection<String> acadAreas, Collection<String> classifications, Collection<String> majors, Collection<String> minors, int priority, boolean mustBeUsed, boolean canAssignOverLimit, boolean allowOverlap)` Constructor
    `` | `CurriculumReservation(long id, double limit, Offering offering, String acadArea, Collection<String> classifications, Collection<String> majors)` Deprecated.
    `protected` | `CurriculumReservation(long id, double limit, Offering offering, String acadArea, Collection<String> classifications, Collection<String> majors, int priority, boolean mustBeUsed, boolean canAssignOverLimit, boolean allowOverlap)` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConcentration(String major, String concentration)` Add concentration for major
    `String` | `getAcademicArea()` Deprecated.
    `Set<String>` | `getAcademicAreas()` Academic areas
    `Set<String>` | `getClassifications()` Academic classifications
    `Set<String>` | `getConcentrations(String major)` Concentrations for major
    `Set<String>` | `getMajors()` Majors
    `Set<String>` | `getMinors()` Minors
    `double` | `getReservationLimit()` Reservation limit (-1 for unlimited)
    `boolean` | `isApplicable(Student student)` Check the area, classifications and majors
    `void` | `setReservationLimit(double limit)` Set reservation limit (-1 for unlimited)

    - ### Methods inherited from class org.cpsolver.studentsct.reservation.Reservation

      `addConfig, addSection, addSection, areRestrictionsInclusive, canAssignOverLimit, canBatchAssignOverLimit, canBreakLinkedSections, canEnroll, compareTo, compareTo, createAssignmentContext, getConfigs, getEnrollments, getId, getLimit, getLimit, getLimitCap, getLimitCap, getModel, getOffering, getPriority, getReservedAvailableSpace, getReservedAvailableSpace, getRestrictivity, getSections, getSections, inheritAssignmentContext, isAllowDisabled, isAllowOverlap, isExpired, isIncluded, mustBeUsed, mustBeUsedIgnoreExpiration, neverIncluded, setAllowDisabled, setAllowOverlap, setBreakLinkedSections, setCanAssignOverLimit, setExpired, setMustBeUsed, setNeverIncluded, setPriority`

    - ### Methods inherited from class org.cpsolver.ifs.assignment.context.AbstractClassWithContext

      `getAssignmentContextReference, getContext, getContext, setAssignmentContextReference`

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

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

- - ### Field Detail

    - #### DEFAULT_PRIORITY

          public static final int DEFAULT_PRIORITY

      Reservation priority (lower than individual and group reservations)
      See Also:
        Constant Field Values

    - #### DEFAULT_MUST_BE_USED

          public static final boolean DEFAULT_MUST_BE_USED

      Curriculum reservation does not need to be used
      See Also:
        Constant Field Values

    - #### DEFAULT_CAN_ASSIGN_OVER_LIMIT

          public static final boolean DEFAULT_CAN_ASSIGN_OVER_LIMIT

      Curriculum reservations can not assign over the limit.
      See Also:
        Constant Field Values

    - #### DEFAULT_ALLOW_OVERLAP

          public static final boolean DEFAULT_ALLOW_OVERLAP

      Overlaps are not allowed for curriculum reservations.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CurriculumReservation

          public CurriculumReservation(long id,
                                       double limit,
                                       Offering offering,
                                       Collection<String> acadAreas,
                                       Collection<String> classifications,
                                       Collection<String> majors,
                                       Collection<String> minors)

      Constructor
      Parameters:
        `id` - unique id
        `limit` - reservation limit (-1 for unlimited)
        `offering` - instructional offering on which the reservation is set
        `acadAreas` - one or more academic areas
        `classifications` - zero or more classifications (classifications must match if not empty)
        `majors` - zero or more majors (majors must match if not empty)
        `minors` - zero or more majors (minors must match if not empty)

    - #### CurriculumReservation

          @Deprecated
          public CurriculumReservation(long id,
                                                   double limit,
                                                   Offering offering,
                                                   String acadArea,
                                                   Collection<String> classifications,
                                                   Collection<String> majors)

      Deprecated.
      Constructor
      Parameters:
        `id` - unique id
        `limit` - reservation limit (-1 for unlimited)
        `offering` - instructional offering on which the reservation is set
        `acadArea` - academic area
        `classifications` - zero or more classifications (classifications must match if not empty)
        `majors` - zero or more majors (majors must match if not empty)

    - #### CurriculumReservation

          protected CurriculumReservation(long id,
                                          double limit,
                                          Offering offering,
                                          Collection<String> acadAreas,
                                          Collection<String> classifications,
                                          Collection<String> majors,
                                          Collection<String> minors,
                                          int priority,
                                          boolean mustBeUsed,
                                          boolean canAssignOverLimit,
                                          boolean allowOverlap)

      Constructor
      Parameters:
        `id` - unique id
        `limit` - reservation limit (-1 for unlimited)
        `offering` - instructional offering on which the reservation is set
        `acadAreas` - one or more academic areas
        `classifications` - zero or more classifications (classifications must match if not empty)
        `majors` - zero or more majors (majors must match if not empty)
        `minors` - zero or more majors (minors must match if not empty)
        `priority` - reservation priority
        `mustBeUsed` - must this reservation be used
        `canAssignOverLimit` - can assign over class / configuration / course limit
        `allowOverlap` - does this reservation allow for overlaps

    - #### CurriculumReservation

          @Deprecated
          protected CurriculumReservation(long id,
                                                      double limit,
                                                      Offering offering,
                                                      String acadArea,
                                                      Collection<String> classifications,
                                                      Collection<String> majors,
                                                      int priority,
                                                      boolean mustBeUsed,
                                                      boolean canAssignOverLimit,
                                                      boolean allowOverlap)

      Deprecated.
      Constructor
      Parameters:
        `id` - unique id
        `limit` - reservation limit (-1 for unlimited)
        `offering` - instructional offering on which the reservation is set
        `acadArea` - academic area
        `classifications` - zero or more classifications (classifications must match if not empty)
        `majors` - zero or more majors (majors must match if not empty)
        `priority` - reservation priority
        `mustBeUsed` - must this reservation be used
        `canAssignOverLimit` - can assign over class / configuration / course limit
        `allowOverlap` - does this reservation allow for overlaps

  - ### Method Detail

    - #### getReservationLimit

          public double getReservationLimit()

      Reservation limit (-1 for unlimited)
      Specified by:
        `getReservationLimit` in class `Reservation`
      Returns:
        reservation limit, -1 for unlimited

    - #### setReservationLimit

          public void setReservationLimit(double limit)

      Set reservation limit (-1 for unlimited)
      Parameters:
        `limit` - reservation limit, -1 for unlimited

    - #### getAcademicAreas

          public Set<String> getAcademicAreas()

      Academic areas
      Returns:
        selected academic areas

    - #### getAcademicArea

          @Deprecated
          public String getAcademicArea()

      Deprecated.
      Academic area
      Returns:
        selected academic area

    - #### getMajors

          public Set<String> getMajors()

      Majors
      Returns:
        selected majors

    - #### getMinors

          public Set<String> getMinors()

      Minors
      Returns:
        selected minors

    - #### getClassifications

          public Set<String> getClassifications()

      Academic classifications
      Returns:
        selected academic classifications

    - #### getConcentrations

          public Set<String> getConcentrations(String major)

      Concentrations for major

    - #### addConcentration

          public void addConcentration(String major,
                                       String concentration)

      Add concentration for major

    - #### isApplicable

          public boolean isApplicable(Student student)

      Check the area, classifications and majors
      Specified by:
        `isApplicable` in class `Reservation`
      Parameters:
        `student` - a student
      Returns:
        true if student can use the reservation to get into the course / configuration / section