001    package net.sf.cpsolver.ifs.solution;
002    
003    /**
004     * IFS solution listener.
005     *
006     * @see Solution
007     *
008     * @version
009     * IFS 1.1 (Iterative Forward Search)<br>
010     * Copyright (C) 2006 Tomáš Müller<br>
011     * <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
012     * Lazenska 391, 76314 Zlin, Czech Republic<br>
013     * <br>
014     * This library is free software; you can redistribute it and/or
015     * modify it under the terms of the GNU Lesser General Public
016     * License as published by the Free Software Foundation; either
017     * version 2.1 of the License, or (at your option) any later version.
018     * <br><br>
019     * This library is distributed in the hope that it will be useful,
020     * but 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.
023     * <br><br>
024     * You should have received a copy of the GNU Lesser General Public
025     * License along with this library; if not, write to the Free Software
026     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
027     */
028    public interface SolutionListener {
029        /** Called by the solution when it is updated, see {@link Solution#update(double)}. 
030         * @param solution source solution
031         */
032        public void solutionUpdated(Solution solution);
033        
034        /** Called by the solution when it is asked to produce info table, see {@link Solution#getInfo()}.
035         * A listener can also add some its info into this table.
036         * @param solution source solution
037         * @param info produced info table
038         */
039        public void getInfo(Solution solution, java.util.Dictionary info);
040        /** Called by the solution when it is asked to produce info table, see {@link Solution#getInfo()}.
041         * A listener can also add some its info into this table.
042         * @param solution source solution
043         * @param info produced info table
044         * @param variables only variables from this set are included
045         */
046        public void getInfo(Solution solution, java.util.Dictionary info, java.util.Vector variables);
047        
048        /** Called by the solution when method {@link Solution#clearBest()} is called.
049         * @param solution source solution
050         */
051        public void bestCleared(Solution solution);
052    
053        /** Called by the solution when method {@link Solution#saveBest()} is called.
054         * @param solution source solution
055         */
056        public void bestSaved(Solution solution);
057    
058        /** Called by the solution when method {@link Solution#restoreBest()} is called.
059         * @param solution source solution
060         */
061        public void bestRestored(Solution solution);
062    }