org.cpsolver.studentsct.reservation

## Class GroupReservation

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

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

      public class GroupReservation
      extends IndividualReservation

  Group reservation. This is basically a `IndividualReservation`, but students cannot be assigned over the limit and the priority is lower than on individual reservations. Also, a different limit than the number of students in the group can be provided.
  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/.

- - ### 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 group reservations.
    `static boolean` | `DEFAULT_CAN_ASSIGN_OVER_LIMIT` Group reservations cannot be assigned over the limit.
    `static boolean` | `DEFAULT_MUST_BE_USED` Individual or group reservation must be used (unless it is expired)
    `static int` | `DEFAULT_PRIORITY` Group reservations are of the second highest priority

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

      `sMaxSize`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `GroupReservation(long id, double limit, Offering offering, Collection<Long> studentIds)` Constructor
    `protected` | `GroupReservation(long id, double limit, Offering offering, int priority, boolean mustBeUsed, boolean canAssignOverLimit, boolean allowOverlap, Collection<Long> studentIds)` Constructor
    `protected` | `GroupReservation(long id, double limit, Offering offering, int priority, boolean mustBeUsed, boolean canAssignOverLimit, boolean allowOverlap, Long... studentIds)` Constructor
    `` | `GroupReservation(long id, double limit, Offering offering, Long... studentIds)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getReservationLimit()` Reservation limit
    `void` | `setReservationLimit(double limit)` Set reservation limit (-1 for unlimited)

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

      `getStudentIds, isApplicable`

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

      `addConfig, addSection, addSection, areRestrictionsInclusive, canAssignOverLimit, canBatchAssignOverLimit, canBreakLinkedSections, canEnroll, compareTo, compareTo, createAssignmentContext, getConfigs, getEnrollments, getId, getLimit, getLimitCap, getModel, getOffering, getPriority, 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

      Group reservations are of the second highest priority
      See Also:
        Constant Field Values

    - #### DEFAULT_MUST_BE_USED

          public static final boolean DEFAULT_MUST_BE_USED

      Individual or group reservation must be used (unless it is expired)
      See Also:
        Constant Field Values

    - #### DEFAULT_CAN_ASSIGN_OVER_LIMIT

          public static final boolean DEFAULT_CAN_ASSIGN_OVER_LIMIT

      Group reservations cannot be assigned over the limit.
      See Also:
        Constant Field Values

    - #### DEFAULT_ALLOW_OVERLAP

          public static final boolean DEFAULT_ALLOW_OVERLAP

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

  - ### Constructor Detail

    - #### GroupReservation

          public GroupReservation(long id,
                                  double limit,
                                  Offering offering,
                                  Long... studentIds)

      Constructor
      Parameters:
        `id` - unique id
        `limit` - reservation limit (-1 for unlimited)
        `offering` - offering for which the reservation is
        `studentIds` - one or more students

    - #### GroupReservation

          public GroupReservation(long id,
                                  double limit,
                                  Offering offering,
                                  Collection<Long> studentIds)

      Constructor
      Parameters:
        `id` - unique id
        `limit` - reservation limit (-1 for unlimited)
        `offering` - offering for which the reservation is
        `studentIds` - one or more students

    - #### GroupReservation

          protected GroupReservation(long id,
                                     double limit,
                                     Offering offering,
                                     int priority,
                                     boolean mustBeUsed,
                                     boolean canAssignOverLimit,
                                     boolean allowOverlap,
                                     Long... studentIds)

      Constructor
      Parameters:
        `id` - reservation unique id
        `limit` - reservation limit (-1 for unlimited)
        `offering` - instructional offering on which the reservation is set
        `priority` - reservation priority
        `mustBeUsed` - must this reservation be used
        `canAssignOverLimit` - can assign over class / configuration / course limit
        `allowOverlap` - does this reservation allow for overlaps
        `studentIds` - one or more students

    - #### GroupReservation

          protected GroupReservation(long id,
                                     double limit,
                                     Offering offering,
                                     int priority,
                                     boolean mustBeUsed,
                                     boolean canAssignOverLimit,
                                     boolean allowOverlap,
                                     Collection<Long> studentIds)

      Constructor
      Parameters:
        `id` - reservation unique id
        `limit` - reservation limit (-1 for unlimited)
        `offering` - instructional offering on which the reservation is set
        `priority` - reservation priority
        `mustBeUsed` - must this reservation be used
        `canAssignOverLimit` - can assign over class / configuration / course limit
        `allowOverlap` - does this reservation allow for overlaps
        `studentIds` - one or more students

  - ### Method Detail

    - #### getReservationLimit

          public double getReservationLimit()

      Reservation limit
      Overrides:
        `getReservationLimit` in class `IndividualReservation`
      Returns:
        reservation limit, -1 for unlimited

    - #### setReservationLimit

          public void setReservationLimit(double limit)

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