I think Udo Dieckmann wrote:
> I'm trying to write what should be a simple little rule.  I'm getting data 
> a database call, and am able to get that into Jess fine.  I've got a
> clp file that's accessing that data fine.  But I now need to do something
> (I'm sure trivial once I get the secret decoder ring) like the following:
> 
> say I have the following data (facts):
> 
> this-week-inventory 15
> last-week-inventory 16
> this-week-sales 23
> last-week-sales 19


So I'll assume the facts were created using something like

(assert (this-week-inventory 15))
(assert (last-week-inventory 16))
etc.

> 
> And I want a rule that says basically:
> 
> IF this-week-inventory IS LESS THAN last-week-inventory
> AND this-week-sales IS GREATER ATHAN last-week-sales
> THEN
> CALL estimate-sales-impact

(defrule my-rule
  (last-week-inventory ?lwi)
  (this-week-inventory ?twi&:(< ?twi ?lwi))
  (last-week-sales ?lws)
  (this-week-sales ?tws&:(> ?tws ?lws))
  =>
  (estimate-sales-impact))


---------------------------------------------------------
Ernest Friedman-Hill  
Science and Engineering PSEs        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

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