I have done the following experiment and can't explain the results:

Try loading this file with batch from the jess> prompt:

(clear)

(deffacts testfacts
        (wme 2)
        (wme 3)
)

(reset)

(defrule r1
        (wme 2)
=>
        (printout t "r1 rules" crlf)
)

(defrule r2
        (wme 2)
        (wme 3)
=>
        (printout t "r2 rules" crlf)
)

I then do the following:

Jess> (agenda)
[Activation: MAIN::r2  f-1, f-2 ; time=3 ; salience=0]
[Activation: MAIN::r1  f-1 ; time=2 ; salience=0]
For a total of 2 activations in module MAIN.
Jess> (run)
r2 rules
r1 rules
2

So far so good.

Now I start over and batch this file:

(clear)

(deffacts testfacts
        (wme 1)
        (wme 2)
        (wme 3)
)

(reset)

(defrule r1
        (wme 2)
        (wme 1)
=>
        (printout t "r1 rules" crlf)
)

(defrule r2
        (wme 2)
        (wme 1)
        (wme 3)
=>
        (printout t "r2 rules" crlf)
)

I then get the following result:

Jess> (agenda)
[Activation: MAIN::r2  f-2, f-1, f-3 ; time=4 ; salience=0]
[Activation: MAIN::r1  f-2, f-1 ; time=3 ; salience=0]
[Activation: MAIN::r1  f-2, f-1 ; time=3 ; salience=0]
For a total of 3 activations in module MAIN.
Jess> (run)
r2 rules
r1 rules
r1 rules
3

This I find very surprising.  Can anybody tell me why I get two activation
of r1 in this case?  And activations with exactly the same wmes no less!

Any light anybody can shed on this would be greatly appreciated.

Rand






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