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