001package org.cpsolver.ifs.model;
002
003import org.cpsolver.ifs.assignment.Assignment;
004
005/**
006 * Interface of a constraint that weakens with the time.
007 * 
008 * @author  Tomáš Müller
009 * @version CourseTT 1.3 (University Course Timetabling)<br>
010 *          Copyright (C) 2006 - 2014 Tomáš Müller<br>
011 *          <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
012 *          <a href="http://muller.unitime.org">http://muller.unitime.org</a><br>
013 * <br>
014 *          This library is free software; you can redistribute it and/or modify
015 *          it under the terms of the GNU Lesser General Public License as
016 *          published by the Free Software Foundation; either version 3 of the
017 *          License, or (at your option) any later version. <br>
018 * <br>
019 *          This library is distributed in the hope that it will be useful, but
020 *          WITHOUT ANY WARRANTY; without even the implied warranty of
021 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
022 *          Lesser General Public License for more details. <br>
023 * <br>
024 *          You should have received a copy of the GNU Lesser General Public
025 *          License along with this library; if not see
026 *          <a href='http://www.gnu.org/licenses/'>http://www.gnu.org/licenses/</a>.
027 * 
028 * @param <V> Variable 
029 * @param <T> Value
030 */
031public interface WeakeningConstraint<V extends Variable<V, T>, T extends Value<V, T>> {
032    /**
033     * Weaken the constraint. This method is called if the constraint
034     * participates in an unassigned of a variable.
035     * @param assignment current assignment
036     */
037    public void weaken(Assignment<V, T> assignment);
038    
039    
040    /**
041     * Weaken the constraint enough so that it can assign the given
042     * value.
043     * @param assignment current assignment
044     * @param value a conflicting value to be assigned
045     */
046    public void weaken(Assignment<V, T> assignment, T value);
047}