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