From: Hadrien C. <h.c...@4c...> - 2007-09-13 16:25:06
|
Hi Carlos, for |x1-x2|=3D1, you can use pb.distanceEQ(x1,x2,1). Otherwise (but it will be less efficient) you can do : pb.eq(pb.minus(x1,x2), y); // y =3D x1 - x2 pb.abs(y2,y); // y2 =3D |y| pb.eq(y2,1); // y2 =3D 1 Hope it helps Hadrien Le 13 Sep 2007 =E0 16:39, Carlos Testera a =E9crit : > Hi. > I'm new to choco. I'm doing some tests and examples with the library, > and I've found a problem. I've searched in the list and in the forum, > but with no results. > I would like to add to my problem a constraint of the type |x1-x2|=3D1 > I've seen the abs method (it is not in the javadoc), but I don't > understand how it works, because it receives two arguments, and I =20 > don't > know their funcionality. Moreover, I've tryed to make a call like > problem.abs(y1,problem.minus(x1,x2)) expecting that it will create a > variable (y1) representing the absolute value of the difference of x1 > and x2, but that method does not allow an IntExp object as argument. > Any help? > > Thanks > > --=20 > Carlos Testera > University of Leon > Leon > Spain > E-mail: > car...@un... > Phone: > +34 987291000 > ext 5432 > > > ----------------------------------------------------------------------=20= > --- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Choco-users mailing list > Cho...@li... > https://lists.sourceforge.net/lists/listinfo/choco-users |