001package org.cpsolver.studentsct.reservation; 002 003import org.cpsolver.studentsct.model.Course; 004import org.cpsolver.studentsct.model.Offering; 005import org.cpsolver.studentsct.model.Student; 006 007/** 008 * Dummy reservation. Use to fill remaining space for offerings that are marked as by reservation only. 009 * 010 * <br> 011 * <br> 012 * 013 * @author Tomáš Müller 014 * @version StudentSct 1.3 (Student Sectioning)<br> 015 * Copyright (C) 2007 - 2014 Tomáš Müller<br> 016 * <a href="mailto:muller@unitime.org">muller@unitime.org</a><br> 017 * <a href="http://muller.unitime.org">http://muller.unitime.org</a><br> 018 * <br> 019 * This library is free software; you can redistribute it and/or modify 020 * it under the terms of the GNU Lesser General Public License as 021 * published by the Free Software Foundation; either version 3 of the 022 * License, or (at your option) any later version. <br> 023 * <br> 024 * This library is distributed in the hope that it will be useful, but 025 * WITHOUT ANY WARRANTY; without even the implied warranty of 026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 027 * Lesser General Public License for more details. <br> 028 * <br> 029 * You should have received a copy of the GNU Lesser General Public 030 * License along with this library; if not see 031 * <a href='http://www.gnu.org/licenses/'>http://www.gnu.org/licenses/</a>. 032 */ 033public class DummyReservation extends Reservation { 034 035 /** 036 * Dummy reservation has low priority 037 */ 038 public static final int DEFAULT_PRIORITY = 600; 039 /** 040 * Dummy reservation does not need to be used 041 */ 042 public static final boolean DEFAULT_MUST_BE_USED = false; 043 /** 044 * Dummy reservations can not assign over the limit. 045 */ 046 public static final boolean DEFAULT_CAN_ASSIGN_OVER_LIMIT = false; 047 /** 048 * Overlaps are not allowed for dummy reservations. 049 */ 050 public static final boolean DEFAULT_ALLOW_OVERLAP = false; 051 052 053 /** 054 * Constructor 055 * @param offering offering on which the reservation is set 056 */ 057 public DummyReservation(Offering offering) { 058 super(offering.getId(), offering, DEFAULT_PRIORITY, DEFAULT_MUST_BE_USED, DEFAULT_CAN_ASSIGN_OVER_LIMIT, DEFAULT_ALLOW_OVERLAP); 059 } 060 061 /** 062 * Dummy reservation is unlimited 063 */ 064 @Override 065 public double getReservationLimit() { 066 return -1; 067 } 068 069 /** 070 * Dummy reservation is not applicable to any students 071 */ 072 @Override 073 public boolean isApplicable(Student student, Course course) { 074 return false; 075 } 076 077}