001    package ifs.model;
002    
003    import java.util.*;
004    
005    /**
006     * IFS constraint listener.
007     *
008     * @see Constraint
009     *
010     * @author <a href="mailto:muller@ktiml.mff.cuni.cz">Tomáš Müller</a>
011     * @version 1.0
012     */
013    public interface ConstraintListener {
014        /** Called by the constraint, before a value is assigned to its variable.
015         * @param iteration current iteration
016         * @param constraint source constraint
017         * @param assigned value which will be assigned to its variable ({@link Value#variable()})
018         * @param unassigned set of conflicting values which will be unassigned by the constraint before it assigns the given value
019         */
020        public void constraintBeforeAssigned(long iteration, Constraint constraint, Value assigned, Set unassigned);
021    
022        /** Called by the constraint, after a value is assigned to its variable.
023         * @param iteration current iteration
024         * @param constraint source constraint
025         * @param assigned value which was assigned to its variable ({@link Value#variable()})
026         * @param unassigned set of conflicting values which were unassigned by the constraint before it assigned the given value
027         */
028        public void constraintAfterAssigned(long iteration, Constraint constraint, Value assigned, Set unassigned);
029    }