net.sf.cpsolver.studentsct.reservation
Class GroupReservation

java.lang.Object
  extended by net.sf.cpsolver.studentsct.reservation.Reservation
      extended by net.sf.cpsolver.studentsct.reservation.IndividualReservation
          extended by net.sf.cpsolver.studentsct.reservation.GroupReservation
All Implemented Interfaces:
Comparable<Reservation>

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.2 (Student Sectioning)
Copyright (C) 2007 - 2010 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/.

Constructor Summary
GroupReservation(long id, double limit, Offering offering, Collection<Long> studentIds)
          Constructor
GroupReservation(long id, double limit, Offering offering, Long... studentIds)
          Constructor
 
Method Summary
 boolean canAssignOverLimit()
          Group reservations can not be assigned over the limit.
 int getPriority()
          Group reservations are of the second highest priority
 double getReservationLimit()
          Reservation limit
 boolean isAllowOverlap()
          Overlaps are allowed for individual reservations.
 void setReservationLimit(double limit)
          Set reservation limit (-1 for unlimited)
 
Methods inherited from class net.sf.cpsolver.studentsct.reservation.IndividualReservation
getStudentIds, isApplicable, mustBeUsed
 
Methods inherited from class net.sf.cpsolver.studentsct.reservation.Reservation
addConfig, addSection, assigned, canEnroll, compareTo, getConfigs, getEnrollments, getId, getLimit, getLimitCap, getOffering, getReservedAvailableSpace, getRestrictivity, getSections, getSections, getUsedSpace, isExpired, isIncluded, setExpired, unassigned
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Method Detail

getPriority

public int getPriority()
Group reservations are of the second highest priority

Overrides:
getPriority in class IndividualReservation

canAssignOverLimit

public boolean canAssignOverLimit()
Group reservations can not be assigned over the limit.

Overrides:
canAssignOverLimit in class IndividualReservation

getReservationLimit

public double getReservationLimit()
Reservation limit

Overrides:
getReservationLimit in class IndividualReservation

setReservationLimit

public void setReservationLimit(double limit)
Set reservation limit (-1 for unlimited)


isAllowOverlap

public boolean isAllowOverlap()
Overlaps are allowed for individual reservations.

Overrides:
isAllowOverlap in class IndividualReservation