From: eran s. <era...@gm...> - 2007-07-30 07:25:35
|
Hello, At first i want thank you all for a wonderful and enjoyably tool you created (Choco). Following "Choco-users Digest, Vol 7, Issue 1", it seemed that and(), or() had some problems. In the file attached, you can see the fix i suggest. Another thing: I am working with Set variables. In the file attached, i added the function opposite() to some classes, so and(), or() won't fail on them (still, i am not sure i added to all classes needed). There are some problems with: choco.bool.AbstractLargeBoolConstraint.setStatus(). With the assert at the beginning. See this code for example: Problem pb = new Problem(); IntDomainVar x1 = pb.makeEnumIntVar("x1", 0, 10); IntDomainVar x2 = pb.makeEnumIntVar("x2", 0, 10); Constraint c2 = pb.gt(x1, 7); Constraint c3 = pb.lt(x2, 3); Constraint c1 = pb.lt(x2, x1); Constraint c = pb.and(c1, c2, c3); pb.post(c); pb.solve(); You will get: Exception in thread "main" java.lang.AssertionError at choco.bool.AbstractLargeBoolConstraint.setStatus(AbstractLargeBoolConstraint.java:81) at choco.bool.AbstractLargeBoolConstraint.setSubConstraintStatus(AbstractLargeBoolConstraint.java:132) at choco.AbstractConstraint.setEntailed(AbstractConstraint.java:207) at choco.integer.constraints.GreaterOrEqualXYC.awakeOnSup(GreaterOrEqualXYC.java:89) at choco.bool.LargeConjunction.awakeOnSup(LargeConjunction.java:52) at choco.integer.var.IntVarEvent.propagateSupEvent(IntVarEvent.java:237) at choco.integer.var.IntVarEvent.propagateEvent(IntVarEvent.java:177) at choco.prop.VarEventQueue.propagateSomeEvents(VarEventQueue.java:54) at choco.AbstractProblem.propagate(AbstractProblem.java:282) at choco.search.AbstractGlobalSearchSolver.incrementalRun(AbstractGlobalSearchSolver.java:153) at choco.Solver.launch(Solver.java:175) at choco.Problem.solve(Problem.java:763) What's wrong? Cheers, Eran Shaham On 7/12/07, cho...@li... <cho...@li...> wrote: > Send Choco-users mailing list submissions to > cho...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/choco-users > or, via email, send a message with subject or body 'help' to > cho...@li... > > You can reach the person managing the list at > cho...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Choco-users digest..." > > > Today's Topics: > > 1. Pb with boolean using version 1.2.04 (coletta) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 12 Jul 2007 11:07:31 +0200 > From: coletta <co...@li...> > Subject: [Choco-users] Pb with boolean using version 1.2.04 > To: cho...@li... > Message-ID: <469...@li...> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Dear all, > > Please find bellow a short TestCase, producing an AssertionError > in AbstractLargeBoolConstraint. > > Thanks for your help ;-) > > Best regards, > -- > Remi > > import static org.junit.Assert.*; > import junit.framework.TestCase; > > import choco.Constraint; > import choco.Problem; > import choco.bool.LargeConjunction; > import choco.integer.IntDomainVar; > import choco.integer.constraints.GreaterOrEqualXYC; > > public class TestChocoBoolean extends TestCase { > > public static void testBoolean() { > Problem pb = new Problem(); > IntDomainVar e1= pb.makeEnumIntVar("e1", 0,4); > IntDomainVar s1= pb.makeEnumIntVar("s1", 0,4); > IntDomainVar e2= pb.makeEnumIntVar("e2", 0,4); > IntDomainVar s2= pb.makeEnumIntVar("s2", 0,4); > > IntDomainVar extraVar= pb.makeEnumIntVar("extra", 0,1); > > Constraint[] tab = new Constraint[3]; > tab[0] = new GreaterOrEqualXYC(e1,s1,0); > tab[1] = new GreaterOrEqualXYC(e2,s2,0); > tab[2] = new GreaterOrEqualXYC(s2,e1,1); > Constraint before = new LargeConjunction(tab); > > pb.post(pb.ifThen(pb.eq(extraVar,1),before)); > pb.solveAll(); > } > } > > > > > ------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > > ------------------------------ > > _______________________________________________ > Choco-users mailing list > Cho...@li... > https://lists.sourceforge.net/lists/listinfo/choco-users > > > End of Choco-users Digest, Vol 7, Issue 1 > ***************************************** > |