From: Maurice D. <Mau...@en...> - 2004-10-19 08:21:48
|
Hello choCoders, I'm trying to solve a scheduling problem with an "implies" IntContraint and I can't find error in my model. Here is the smallest sample that (raise the java.lang.AssertionError I also tried: - replacing pb.makeBoundIntVar bu pb.makeEnumIntVar without success - replacing the Contraint by various equivalent boolean equations without success Here is the Main class to test. == START =================================== package rcp; import choco.integer.IntVar; import choco.Constraint; import choco.Problem; import choco.ContradictionException; public class Main { public static void main(String[] args) { Problem pb = new Problem(); IntVar phi_1_2 = pb.makeBoundIntVar("phi_1_2", 0, 3); IntVar phi_2_1 = pb.makeBoundIntVar("phi_2_1", 0, 3); IntVar S_1 = pb.makeBoundIntVar("S_1", 0, 15); IntVar S_2 = pb.makeBoundIntVar("S_2", 0, 15); // C2_1: phi_1_2 > 0 => S_2 - S_1 >= p_1 + v_1_2 Constraint cst1 = pb.implies( pb.gt(phi_1_2, 0), pb.geq(pb.minus(S_2, S_1), 8) ); pb.post(cst1); try { System.out.println("AVANT solve()"); pb.solve(); System.out.println("APRES solve()"); } catch(java.lang.AssertionError e) { e.printStackTrace(); System.out.println("\n Viol d'assertion !\n"); System.exit(1); } System.out.println(("propagate() ou solve()... fait.")); System.out.println("END main"); } // main } //./ == END =================================== -- Maurice |