001    package net.sf.cpsolver.ifs.heuristics;
002    
003    import net.sf.cpsolver.ifs.model.Neighbour;
004    import net.sf.cpsolver.ifs.model.Value;
005    import net.sf.cpsolver.ifs.model.Variable;
006    import net.sf.cpsolver.ifs.solution.Solution;
007    import net.sf.cpsolver.ifs.solver.Solver;
008    
009    /**
010     * Neighbour selection criterion. <br>
011     * <br>
012     * In each iteration of the solver, a neighbour is selected and assigned (by
013     * default {@link StandardNeighbourSelection} is employed).
014     * 
015     * @see Solver
016     * 
017     * @version IFS 1.2 (Iterative Forward Search)<br>
018     *          Copyright (C) 2006 - 2010 Tomas Muller<br>
019     *          <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
020     *          <a href="http://muller.unitime.org">http://muller.unitime.org</a><br>
021     * <br>
022     *          This library is free software; you can redistribute it and/or modify
023     *          it under the terms of the GNU Lesser General Public License as
024     *          published by the Free Software Foundation; either version 3 of the
025     *          License, or (at your option) any later version. <br>
026     * <br>
027     *          This library is distributed in the hope that it will be useful, but
028     *          WITHOUT ANY WARRANTY; without even the implied warranty of
029     *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
030     *          Lesser General Public License for more details. <br>
031     * <br>
032     *          You should have received a copy of the GNU Lesser General Public
033     *          License along with this library; if not see <http://www.gnu.org/licenses/>.
034     **/
035    public interface NeighbourSelection<V extends Variable<V, T>, T extends Value<V, T>> {
036        /** Criterion initialization */
037        public void init(Solver<V, T> solver);
038    
039        /**
040         * select a neighbour of a given solution
041         * 
042         * @param solution
043         *            given solution
044         * @return a neighbour assignment
045         */
046        public Neighbour<V, T> selectNeighbour(Solution<V, T> solution);
047    
048    }