net.sf.cpsolver.studentsct.reservation
Class IndividualReservation

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

public class IndividualReservation
extends Reservation

Individual reservation. A reservation for a particular student (or students).

Version:
StudentSct 1.2 (Student Sectioning)
Copyright (C) 2007 - 2010 Tomas Muller
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
IndividualReservation(long id, Offering offering, Collection<Long> studentIds)
          Constructor
IndividualReservation(long id, Offering offering, Long... studentIds)
          Constructor
 
Method Summary
 boolean canAssignOverLimit()
          Individual reservations are the only reservations that can be assigned over the limit.
 int getPriority()
          Individual reservations are of the top priority
 double getReservationLimit()
          Reservation limit == number of students in the reservation
 Set<Long> getStudentIds()
          Students in the reservation
 boolean isAllowOverlap()
          Overlaps are allowed for individual reservations.
 boolean isApplicable(Student student)
          Reservation is applicable for all students in the reservation
 boolean mustBeUsed()
          Individual or group reservation must be used (unless it is expired)
 
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

IndividualReservation

public IndividualReservation(long id,
                             Offering offering,
                             Long... studentIds)
Constructor

Parameters:
id - unique id
offering - offering for which the reservation is
studentIds - one or more students

IndividualReservation

public IndividualReservation(long id,
                             Offering offering,
                             Collection<Long> studentIds)
Constructor

Parameters:
id - unique id
offering - offering for which the reservation is
studentIds - one or more students
Method Detail

canAssignOverLimit

public boolean canAssignOverLimit()
Individual reservations are the only reservations that can be assigned over the limit.

Specified by:
canAssignOverLimit in class Reservation

mustBeUsed

public boolean mustBeUsed()
Individual or group reservation must be used (unless it is expired)

Specified by:
mustBeUsed in class Reservation
Returns:
true if not expired, false if expired

getPriority

public int getPriority()
Individual reservations are of the top priority

Specified by:
getPriority in class Reservation

isApplicable

public boolean isApplicable(Student student)
Reservation is applicable for all students in the reservation

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

getStudentIds

public Set<Long> getStudentIds()
Students in the reservation


getReservationLimit

public double getReservationLimit()
Reservation limit == number of students in the reservation

Specified by:
getReservationLimit in class Reservation

isAllowOverlap

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

Overrides:
isAllowOverlap in class Reservation


Copyright © 2014 UniTime LLC. All Rights Reserved.