Why not use three seperate rules for each threshold?

--- John Barr <[EMAIL PROTECTED]> wrote:
> 
> (defrule notify-with-reason
>     (thresholds (RPM ?RPM-threshold)
>                 (Temperature ?Temperature-threshold)
>                 (Pressure ?Pressure-threshold))
>     (data-set (RPM ?RPM-value)
>               (Temperature ?Temperature-value)
>               (Pressure ?Pressure-value))
>     (test (or (> ?RPM-value ?RPM-threshold)
>               (> ?Temperature-value
> ?Temperature-threshold)
>               (> ?Pressure-value
> ?Pressure-threshold)))
> =>
>     (bind ?reason-code 0)
>     (if (> ?RPM-value ?RPM-threshold)
>         then (bind ?reason-code (bit-or ?reason-code
> 1)))
>     (if (> ?Temperature-value
> ?Temperature-threshold)
>         then (bind ?reason-code (bit-or ?reason-code
> 2)))
>     (if (> ?Pressure-value ?Pressure-threshold)
>         then (bind ?reason-code (bit-or ?reason-code
> 4)))
>     (printout t "THRESHOLD EXCEEDED, REASON CODE IS
> " ?reason-code crlf))
> 
> (reset)



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to