import choco.Problem; import choco.ContradictionException; import choco.integer.*; public class MyProblem extends Problem { int[] inst; long nodes; long time; public MyProblem() { super(); nodes = 0; time = 0; } private boolean isConsistent(DecisionVar[] v,int i,int x) throws ContradictionException { //System.out.println("isConsistent(" + v[i] + "," + i + "," + x + ")"); nodes++; boolean consistent = true; inst[i] = x; try{v[i].setVal(x);super.propagate();} catch (ContradictionException e) {consistent = false;} return consistent; } // // test if the problem can be made AC when v takes value x // public long getNodes(){return nodes;} public long getTime(){return time;} private int getPotentialDiscrepancies(DecisionVar[] v,int n,int i){ int pd = 0; for (int j=i;j