001package org.cpsolver.ifs.heuristics;
002
003import org.cpsolver.ifs.model.Neighbour;
004import org.cpsolver.ifs.model.Value;
005import org.cpsolver.ifs.model.Variable;
006import org.cpsolver.ifs.solution.Solution;
007import org.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 * @author  Tomáš Müller
018 * @version IFS 1.3 (Iterative Forward Search)<br>
019 *          Copyright (C) 2006 - 2014 Tomáš Müller<br>
020 *          <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
021 *          <a href="http://muller.unitime.org">http://muller.unitime.org</a><br>
022 * <br>
023 *          This library is free software; you can redistribute it and/or modify
024 *          it under the terms of the GNU Lesser General Public License as
025 *          published by the Free Software Foundation; either version 3 of the
026 *          License, or (at your option) any later version. <br>
027 * <br>
028 *          This library is distributed in the hope that it will be useful, but
029 *          WITHOUT ANY WARRANTY; without even the implied warranty of
030 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
031 *          Lesser General Public License for more details. <br>
032 * <br>
033 *          You should have received a copy of the GNU Lesser General Public
034 *          License along with this library; if not see <a href='http://www.gnu.org/licenses'>http://www.gnu.org/licenses</a>.
035 *
036 * @param <V> Variable
037 * @param <T> Value
038 **/
039public interface NeighbourSelection<V extends Variable<V, T>, T extends Value<V, T>> {
040    /** Criterion initialization 
041     * @param solver current solver
042     **/
043    public void init(Solver<V, T> solver);
044
045    /**
046     * select a neighbour of a given solution
047     * 
048     * @param solution
049     *            given solution
050     * @return a neighbour assignment
051     */
052    public Neighbour<V, T> selectNeighbour(Solution<V, T> solution);
053
054}