    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 * @version IFS 1.3 (Iterative Forward Search)<br>
    018 *          Copyright (C) 2006 - 2014 Tomáš Müller<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 <a href='http://www.gnu.org/licenses'>http://www.gnu.org/licenses</a>.
    034 *
    035 * @param <V> Variable
    036 * @param <T> Value
    037 **/
    038public interface NeighbourSelection<V extends Variable<V, T>, T extends Value<V, T>> {
    039    /** Criterion initialization
    040     * @param solver current solver
    041     **/
    042    public void init(Solver<V, T> solver);
    043
    044    /**
    045     * select a neighbour of a given solution
    046     *
    047     * @param solution
    048     *            given solution
    049     * @return a neighbour assignment
    050     */
    051    public Neighbour<V, T> selectNeighbour(Solution<V, T> solution);
    052
    053}