I think [EMAIL PROTECTED] wrote:
> Over the last week, I have enjoyed reading JESS in Action from cover to 
> cover and doing my fair share of tinkering.  

Glad you enjoyed the book!


> use the focus stack to determine module firing sequence and rule set to 
> fire for a run (channels would have different focus stacks before calling 
> run)

Good, yes. People don't make enough use of modules, I think.

> store each module in a separate file to simplify maintenance and change 
> control

Also good.

> Instead of retracting facts, I could call reset at the end of each run and 
> then assert my static facts.  I am assuming that the greater the amount of 
> static facts, the worse this option will perform.  Is that true? 

It really depends on what the rules look like. reset has two parts: a
fast part where all the old facts are removed, and then a potentially
slower part where deffacts are asserted (or equivalently, where you'd
reassert your static facts.) How slow this is depends on how much
pattern matching the rules do on just these facts. If there are
combinatorial rules -- i.e., if we form pairs or triples of the static
facts -- then this will probably be slower than just retracting the
dynamic data.


> The  static facts would be coming from a database.  Could I use deffacts or 
> something similar to ensure that reset quickly returns to an initial state 
> with around 1000 static facts? 

You could *try* using (bload) to load a binary image of the static
data; this may be either faster or slower, again, depending on your
rules. But probably just deleting the transient data is better.
See http://www.mail-archive.com/[EMAIL PROTECTED]/msg03265.html
for a really nifty piece of code that implements unwind/protect --
a sort of "rollback" for Jess that would do exactly what you want.

> My understanding of the single Rete's drawbacks is that I have to
> worry about thread blocking and the rules will be slightly more
> complex.  Are there any other important distinctions between the two
> approaches?

Pooling is fine as long as the extra memory is OK. Again, the numbers
depend on what your actual rules look like.



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