It is my belief that if JESS had a capability similar to CLIPS's
defmodule for partitioning the rule base, then the rules in the
individual modules could be selectively (as a group) allowed
to fire (those on the agenda of the active modules) excluding
those in other inactive module partitions. This could easily
be controlled both from JESS and Java using a CLIPS-like
"focus" feature.
In Willie Wheeler's second example, placing each of the rules
into separate modules would allow such control by only allowing
rule evaluation to focus on the desired module(s) and rule group(s).
In fact, CLIPS's focus features allows a "stacking" capability to
provide a pre-determined ordering of module activations.
-Ed Katz
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 3:18 PM
To: Willie Wheeler
Cc: [EMAIL PROTECTED]
Subject: Re: JESS: Controlling rule firing
You should be able to achieve what you want by writing a custom
Strategy object. This recently became VASTLY simpler than it once
was. See the jess.Strategy interface and the jess.breadth and
jess.depth implementation classes. This wil let you move the rule you
want to fire next to the top of the Agenda. Then use dynamic
salience, to force the agenda to be reordered before each cycle. Then
use (run 1) in a loop and stop calling it when there are no more rules
that you want to be fired.
I think Willie Wheeler wrote:
> Hi all,
>
> In the application I am writing, I need to be able to choose rules
> in two different ways. The first is just the standard fact-driven way,
> and there is no problem here. But for the second way, the Java program in
> which Rete is embedded needs to be able to choose which activated rule to
> fire. Is there a way to do this?
>
> Thanks,
> Willie
>
---------------------------------------------------------
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]
---------------------------------------------------------------------