001package org.cpsolver.studentsct.online.expectations;
002
003import org.cpsolver.ifs.assignment.Assignment;
004import org.cpsolver.studentsct.model.Enrollment;
005import org.cpsolver.studentsct.model.Request;
006import org.cpsolver.studentsct.model.Section;
007
008/**
009 * Over-expected criterion interface. Various implementations can be provided.
010 * 
011 * @version StudentSct 1.3 (Student Sectioning)<br>
012 *          Copyright (C) 2014 Tomas Muller<br>
013 *          <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
014 *          <a href="http://muller.unitime.org">http://muller.unitime.org</a><br>
015 * <br>
016 *          This library is free software; you can redistribute it and/or modify
017 *          it under the terms of the GNU Lesser General Public License as
018 *          published by the Free Software Foundation; either version 3 of the
019 *          License, or (at your option) any later version. <br>
020 * <br>
021 *          This library is distributed in the hope that it will be useful, but
022 *          WITHOUT ANY WARRANTY; without even the implied warranty of
023 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
024 *          Lesser General Public License for more details. <br>
025 * <br>
026 *          You should have received a copy of the GNU Lesser General Public
027 *          License along with this library; if not see <a href='http://www.gnu.org/licenses'>http://www.gnu.org/licenses</a>.
028 * 
029 */
030public interface OverExpectedCriterion {
031    /**
032     * Expectation penalty, to be minimized
033     * @param assignment current assignment
034     * @param section section in question
035     * @param request student course request
036     * @return expectation penalty (typically 1.0 / number of subparts when over-expected, 0.0 otherwise)
037     */
038    public double getOverExpected(Assignment<Request, Enrollment> assignment, Section section, Request request);
039    
040    /**
041     * Expected space, for printing purposes
042     * @param sectionLimit section limit, see {@link Section#getLimit()}
043     * @param expectedSpace expectation, see {@link Section#getSpaceExpected()}
044     * @return expected space to be printed (null if there are no expectations)
045     */
046    public Integer getExpected(int sectionLimit, double expectedSpace);
047}