There doesn't appear to be anything wrong here; perhaps the problem is
elsewhere in your script. You could use (watch all) to follow some of
what is happening; then you'd have a better idea of what rules were
firing and why.

I think Raj Ganesan wrote:
> 
> Hi,
> 
> I'm new to Jess & expert systems as well. I'm basing my code on the Pump/Tank 
>example provided. Basically the goal of the experiment is: offer a first-time 
>promotion to a first-time user, else offer an ongoing promotion.
> 
> The UserBean has some promotion properties (counter,name,value) that are set if the 
>rule fires. I am assuming that when the RHS of the rule is evaluated, the code in the 
>RHS will set the bean properties appropriately.
> 
> However, the following code (in a .clp file) loops infinitely. Why?
> 
> (defclass UserBean test.ruleEngine.UserBean )
> 
> 
> (defrule qualify-for-first
> (UserBean (name ?name) (promoCounter ?counter) (promoValue ?value) (promoName 
>?pName) (OBJECT ?user))
>     (test (= ?counter 0))
>     =>
>     (printout t "User " ?name " has qualified for a first time promotion of $10.00! 
>" crlf)    
>     (printout t "increased promotion counter to " (get ?user promoCounter) crlf
>                 "before promoName is " (get ?user promoName) crlf
>                 "before promoValue is " (get ?user promoValue) crlf)
>     (set ?user promoCounter (+ ?counter 1))
>     (set ?user promoName "First Time Promotion")
>     (set ?user promoValue 10.00)
>     (printout t "increased promotion counter to " (get ?user promoCounter) crlf
>                 "now promoName is " (get ?user promoName) crlf
>                 "now promoValue is " (get ?user promoValue) crlf)
>     )
> 
>  
> 
> 
> 
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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