Hi,

I'm currently using salience to control the order in which various sets of rules fire.
I have '*processdone' checks in every rule like:

(defrule step1_99
(declare (salience 100))
(and
(rule_process_Rulenum (OBJECT ?Rulenum_obj)(ruleid
                     99
                )(preprocessdone
                     "NO")
                (unitvalue
                    ?unitval)
                ...........
)
=>
............
)


and switch rules like

(defrule switch_pre_to_next
(declare (salience 50))
(rule_process_Rulenum (OBJECT ?Rulenum_obj)
            (preprocessdone
                     "NO")
)
=>
(call ?
Rulenum_obj setPreprocessdone "YES"))

and then second stage rules like:

(defrule step2_99
(declare (salience 0))
(and
(rule_process_Ruleden (OBJECT ?Ruleden_obj)(ruleid  99 )
                (unitvalue
                    ?unitval)
                ...........
)
(rule_process_Rulenum (OBJECT ?Rulenum_obj)(ruleid
                     99
                )(preprocessdone
                     "YES")
                (unitvalue
                    ?unitval)
                ...........
)
)
=>

............
)


I believe I can achieve the same effect by putting different stages of the process in different modules and a low salience rule calling switch focus. Will the use of modules in this case result in any significant performance gains?

Thanks


[EMAIL PROTECTED] wrote:
I think Alexander Lamb wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
  
Hello,

If I split my rules into several modules. Will it have an effect on
performance (e.g. Improving performance when having several hundreds of
rules)?
In the documentation, it is said that a module that is not the focus module
can have rules activated but not fire. If they are activated, even if the
focus is not on the module, it means they are evaluated, so the answer is
probably no?

Am I correct here?
    

Using multiple modules will not affect pattern-matching performance,
because all pattern-matching will still be done. However, it may
slightly improve performance of agenda management if you have a lot of
rules active at once. Each module's agenda is a heap-based priority
queue, so rule activation is amortized O(ln N) where N is the number
of active rules in the relevant module. A number of small agenda will
therefore be faster than one big one -- at least, a little bit.




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

  

--
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Reply via email to