On 9/20/07, George Rudolph <[EMAIL PROTECTED]> wrote: > I would like help with the following Gecode/J script. > As indicated below, when I uncomment the calls to count > and run the script, it fails--but I am expecting two results. > What am I doing incorrectly? > (Note: For those it may interest, I am using Gecode/J with Eclipse.) > > --------- begin code ----------- > /** need help with these -- when I uncomment these constraints > * and run, I get a failed space, but I am expecting two results: > * [1,2,2,1] and [2,1,1,2] > * What have I done incorrectly? > */ > //n1 slots have the value lambda1, n2 slots have the value lambda2 > // what I want to say is "exactly n1 elements have the value lambda1 > in q" > // for example. > //count(this, q, n1, IRT_EQ, lambda1, opt.icl ); > //count(this, q, n2, IRT_EQ, lambda2, opt.icl ); > --------- end code -----------
The first constraint says that lambda1 of the variables in q should equal n1, and similarly for the second. See more in the documentation for count: http://www.gecode.org/gecodej/doc/group__TaskIntIntCard.html Cheers, Mikael -- Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/ _______________________________________________ Gecode users mailing list [EMAIL PROTECTED] https://www.gecode.org/mailman/listinfo/gecode-users
