// // What is a bound integer variable? // What effect does this have on propagation? // // v1,v2 in {1..10} // v1 = v2 * 2 // import org.chocosolver.solver.Model; import org.chocosolver.solver.Solver; import org.chocosolver.solver.variables.IntVar; import org.chocosolver.solver.exception.ContradictionException; public class BoundVar { public static void main(String args[]) throws ContradictionException { Model model = new Model("Bound Var"); Solver solver = model.getSolver(); boolean bound = args[0].equals("true"); IntVar v1 = model.intVar("v1",1,10,bound); IntVar v2 = model.intVar("v2",1,10,bound); model.arithm(v1,"=",v2,"*",2).post(); System.out.println("Before propagation: "+ v1 +" "+ v2); solver.propagate(); System.out.println("After propagation: "+ v1 +" "+ v2); //while(solver.solve()) solver.solve(); System.out.println("solution: "+ v1 +" "+ v2); //System.out.println(solver.getMeasures()); } }