001    package net.sf.cpsolver.ifs.heuristics;
002    
003    import net.sf.cpsolver.ifs.model.*;
004    import net.sf.cpsolver.ifs.solution.*;
005    import net.sf.cpsolver.ifs.solver.*;
006    
007    /**
008     * Value selection criterion.
009     * <br><br>
010     * After a variable is selected, we need to find a value to be assigned to the variable. This problem is usually called
011     * "value selection" in constraint programming. Typically, the most useful advice is to select the best-fit value.
012     * So, we are looking for a value which is the most preferred for the variable and which causes the least trouble as well.
013     * This means that we need to find a value with the minimal potential for future conflicts with other variables.
014     * For example, a value which violates the smallest number of soft constraints can be selected among those with
015     * the smallest number of hard conflicts.
016     * <br><br>
017     * The task of this criterion is to select a value of the given variable which will be assigned to this variable.
018     *
019     * @see Solver
020     *
021     * @version
022     * IFS 1.1 (Iterative Forward Search)<br>
023     * Copyright (C) 2006 Tomáš Müller<br>
024     * <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
025     * Lazenska 391, 76314 Zlin, Czech Republic<br>
026     * <br>
027     * This library is free software; you can redistribute it and/or
028     * modify it under the terms of the GNU Lesser General Public
029     * License as published by the Free Software Foundation; either
030     * version 2.1 of the License, or (at your option) any later version.
031     * <br><br>
032     * This library is distributed in the hope that it will be useful,
033     * but WITHOUT ANY WARRANTY; without even the implied warranty of
034     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
035     * Lesser General Public License for more details.
036     * <br><br>
037     * You should have received a copy of the GNU Lesser General Public
038     * License along with this library; if not, write to the Free Software
039     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
040     **/
041    public interface ValueSelection {
042        /** Initialization */
043        public void init(Solver solver);
044        /** Value selection
045         * @param solution current solution
046         * @param selectedVariable selected variable
047         */
048        public Value selectValue(Solution solution, Variable selectedVariable);
049    }