Or, just a thought, you could use a goal-oriented approach such that the first CE of the rule is a Goal object with a Name, usually a literal equal to a integer for speed considerations and to avoid the String.equals(String) method.  All of the rules having to do with one stage would ask "if the goal is xxx" and CE1 and CE2 THEN AE1 and AE2.  Remember, the rule in one set of goals could set another goal if necessary and, when finished, the rules would return to the calling set of goals.  For this you would need depth first, meaning that the last activated goal would be the first on the agenda table.  I've used this quite a number of times fairly successfully without having to resort to priorities. 

BTW, in answer to the earlier question, most treatise on the subject of rulebased systems say something like, "If more than three levels of priority are needed this probably indicates that a procedural program would be better fitted for the solution to the problem."  I know that the Girratano and Riley book has this statement as well as the Cooper and Wogrin book.  I usually insert a Goal named "Start" where Start is a static final int = 0.  Other goals could do different things and you would not have break things into rulesets to accomplish this.

SDG
jco

Jason Morris wrote:
I think that Ross Judson said:
  
There are a couple of additional techniques you can use to control rule
      
firing order.

FYI - There are two more ways:
1.  Flip the order in which Jess fires facts on the agenda (first activated
= first to fire) by using the (set-strategy breadth) command -- a depth
first (last activated = first to fire) strategy is the default.
2.  You can create your own strategies by creating a class that implements
the jess.Strategy interface (JIA pp. 121 sec 7.5.1-7.5.1) then pass that
class name to (set-strategy).

Cheers,

-Jason

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