FD.abs

Torsten Anders t.anders at nici.kun.nl
Tue Feb 5 20:32:31 CET 2002


On Tuesday 05 February 2002 15:09, Frank Rehberger wrote:
> On Tue, 2002-02-05 at 15:15, Torsten Anders wrote:
> > Hi,
> >
> > For a FD search I need the absolute value of a difference. So far I came
> > only up with a solution introducing a choice point (see example below).
> > Can this be done without?
> >
> > proc {AbsDiff X Y Z}
> >    dis (Y-X) >=: 0 then Z =: Y-X
> >    [] (Y-X) <: 0 then Z =: X-Y
> >    end
> > end
>
> {FD,distance X Y Z}

Thanks and sorry for bothering you -- I should have found this myself 
actually 8~)

Regards,
Torsten

-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-users mailing list