Thanks for the suggestion about using control facts.  It has worked well to 
solve my problem.  Since I am new to the rule-based programming paradigm, I 
was not sure how to tackle this problem.  I am finding rule-based 
programming requires a different mind-set when solving a problem; analogous 
to switching from a procedural paradigm to an OO paradigm.


>From: "Mickes studentmail" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Re: JESS: appropriate use of 'if' function?
>Date: Fri, 19 Apr 2002 10:11:05 +0200
>
>You could assert what is known as a control fact(s) which would disable the 
>other threshold-detecting rules once one rule has been fired and a 
>notification has been sent. You would also have to come up with rules which 
>retract the control facts for example when a "normal" situation has been 
>reached again.  The application you are developing sounds a bit like an 
>example in the book "Expert Systems Principles and Programming" by 
>Giarrantano & Riley (ISBN 0-534-95053-1) which I have found most 
>illuminating when learning declarative programming.
>/ regards,
>Mikael
>----- Original Message -----
>From: "John Barr" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, April 18, 2002 11:27 PM
>Subject: Re: JESS: appropriate use of 'if' function?
>
>
> > I only want one notification no matter how many thresholds are exceeded 
>in a
> > data set.  How can this be done using three separate rules?
> >
> > Thanks,
> > John
> >
> >
> > >From: "x xu" <[EMAIL PROTECTED]>
> > >Reply-To: [EMAIL PROTECTED]
> > >To: [EMAIL PROTECTED]
> > >Subject: Re: JESS: appropriate use of 'if' function?
> > >Date: Thu, 18 Apr 2002 14:12:14 -0700 (PDT)
> > >
> > >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]
> > >--------------------------------------------------------------------
> > >
> >
> >
> > _________________________________________________________________
> > Join the world's largest e-mail service with MSN Hotmail.
> > http://www.hotmail.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]
> > --------------------------------------------------------------------
> >
> >
>
>
>
>--------------------------------------------------------------------
>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]
>--------------------------------------------------------------------
>


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--------------------------------------------------------------------
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