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