Spoke too early...with our small test case things worked well. When applying the change to a larger scale model. When running in a larger enviroment with more activity, we're not seeing rules fire at all except for a small set early. (Can't think of anything significant in our stuff that happens early that would change the behavior of Agenda)
We've got a thread filling Jess and updating attributes in the beans(facts) and another thread calling the runUntilHalt. To make things a bit more complicated, we've got another thread doing other great things. I'm not really sure where the problem is yet...I'll be in touch. One thing I noticed was that you had a synchronized block around the getNextActivation call within the loop but the loop itself makes the same call. Scott -----Original Message----- From: [EMAIL PROTECTED] [mailto:owner-jess-users@;sandia.gov]On Behalf Of Scott Gallant Sent: Thursday, October 10, 2002 11:58 PM To: [EMAIL PROTECTED] Subject: RE: JESS: run-until-halt and salience Put the changes into Jess61a3 and it worked as you suspected. Threads working properly is a bit harder to diagnose than threads behaving badly though. We ran our stuff about 15 times with some debug statements put in and everything seemed to work through the salience correctly. Lack of errors, doesn't necessarilly mean success, but we'll be running the code an awful lot and will let you know if we see any discrepencies. Thank you very much, Scott -----Original Message----- From: [EMAIL PROTECTED] [mailto:owner-jess-users@;sandia.gov]On Behalf Of [EMAIL PROTECTED] Sent: Thursday, October 10, 2002 10:00 PM To: [EMAIL PROTECTED] Subject: Re: JESS: run-until-halt and salience I think [EMAIL PROTECTED] wrote: > > This is a really interesting problem -- your diagnosis skills are > excellent. The current behavior certainly is logical and practical, > but unfortunately, you're right, it does make salience somewhat > less... salient. > > One possibility would be for Jess to be modified such that all the > activations due to a single assertion, retraction, or modification > must appear on the agenda atomically, such that no rules could fire > while they were being added. I'll have to think about whether this is > desirable or even possible. > Scott -- There's actually a very easy way to implement this idea; I'd love it if you'd try it and report back. In any recent version of Jess, in jess/Agenda.java, in the two-argument form of run(), there's a while loop that looks like this: while (!m_halt && n < max && (a = getNextActivation(r)) != null) { ... } Change it to look like this: while (!m_halt && n < max) { synchronized (r.getCompiler()) { if (a = getNextActivation(r)) == null) break; ... } } This will ensure that no rule can fire while an assert, retract, or modify is executing on another thread. Let me know how it goes. --------------------------------------------------------- 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] -------------------------------------------------------------------- -------------------------------------------------------------------- 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] -------------------------------------------------------------------- -------------------------------------------------------------------- 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] --------------------------------------------------------------------
