import java.util.HashMap; import java.util.Iterator; import java.util.Vector; class Check{ /** * Checks if all constraints have been satisfied * * @param csp * the CSP instance to check * * @return truth value of check */ public static boolean checkSAT(CSP csp){ for (int i=0;i0) return true; return false; } /** * * @param v_a * a object * * @param csp * the current CSP instance * * @return true if we can perform a decide with the specified VarAssign */ public static boolean canDecide(VarAssign v_a,CSP csp){ HashMap currentAssignment=new HashMap(csp.assignment); currentAssignment.put(v_a.getVar(), v_a.getAssign()); for (int i=0;i