I think Nazar Saeed wrote:
> 
> 
> Can anybody tell me more about Salience.
> For Example i wrote something like this:
> 
> (rule 1
> (declare (seliance 100))
...
> 
> (rule 2
> (declare (seliance -100))
...
> 
> (rule 3
> (declare (seliance -500))
...

> but by the execution the order won't be held, i mean rule 3 is not always
> the last rule which fire.
> 

Salience only orders rules which are on the agenda at the same
time; for example, here rule-2 will fire second, even though it has
higher salience, because rule-2 is activated by the (reset), while
rule-1 is not activated until rule-2 fires.

(defrule rule-1 (declare (salience -1)) (foo) => )
(defrule rule-2 (declare (salience  1))  => (assert (foo))
(reset)
(run)

If you want to assure that a rule doesn't fire until some other rule
has fired, have the earlier rule assert a fact which the later rules
must match; this is a much betterapproach than using salience. Note,
also, that any use of salience will incur a performance penalty.

> How to set the Salience-Strategy.
> 

You can use the set-strategy command to affect the order in which
rules fire, but the built-in strategies (breadth and depth) differ
only in the way in which activations of the same salience are ordered;
they both behave the same way with respect to salience.

If you're using Jess 5.0a(X) and you believe your rules are not firing
in the correct order, please send me a concise sample script which
displays the problem. There could very well be bugs (although the
agenda-ordering code has been very thoroughly tested by now).

> 
> 
> greeting 
> Nazar Saeed
> 

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9214                  [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