From: Guillaume R. <Gui...@em...> - 2004-10-19 15:45:29
|
Hi Maurice ! How are you doing ? Well I tried your program with my Choco installation, and it worked perfectly : --------- AVANT solve() Pb[4 vars, 1 cons] phi_1_2[0, 0] phi_2_1[0, 0] S_1[0, 0] S_2[0, 0] APRES solve() propagate() ou solve()... fait. END main -- solve => 1 solutions -- 5[+0] millis. -- 4[+0] nodes ----------- -> either we removed a bug in the last weeks (but I don't think so, because we only corrected bugs in Palm here) -> or you are still using a previous version of Choco. The last version is 0.9b003 :) So if this is the case, just try with the last version, and I think it will work perfectly ! Let me know if you still have a problem ! Regards, Guillaume On Tuesday 19 October 2004 10:18, Maurice Diamantini wrote: > 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 > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Choco-users mailing list > Cho...@li... > https://lists.sourceforge.net/lists/listinfo/choco-users |