In general, as another poster has already pointed out, you don't want
to tell the Rete algorithm the order in which you want the rules
fired. If you know the order, well, then it's probably better to just
write procedural code to do what ever you want, deterministically.

If you want to have some control over the ordering though, you do have
two tools. One is salience. Most of the time people used fixed
sallience -- i.e., they declare a large salience value for one or more
rules that, if active, should always fire right away, or a large
nagative one for rules that should never fire if any other rules are
active. Dynamic salience -- i.e., the various mechanisms by which you
can have salience evaluated repeatedly -- are rarely used and by
definition are very inefficient, since the rules may have to be
reordered after each one is fired.u

The other tool you have is the conflict resolution strategy.  This
lets you order activations based on some criteria. The two built-in
ones, depth and breadth, just use time as their criteria -- i.e.,
activations are ordered based on the relative times at which they were
created. It is possible to define your own, more complex strategies
which might use other criteria.

I don't know if you meant your example to be realistic or not, but
it's a poor example of how to write a scheduler. You'd want to define
facts to represent the jobs, and define rules to operate on those
facts, and produce, as output, more facts describing the order in
which the jobs should run. Then some altogether separate mechanism
would read those facts and execute the jobs. Letting rule-firing
correspond to job execution is mixing apples and oranges.



I think Ryan Cairns wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> 
> Hello Everyone,
> 
> 
>       I'm confused about how you would priortize facts in the JESS
> knowledge base. For instance, in a sheduler, there will be several
> possible jobs to be run on one processor, but I want the job with the
> highest priority to run first.  Any suggestions on this?  I've only read
> briefly about salience and it doesn't seem clear.
> 
> Thanks
> 
> -Ryan
> 
> 
> 



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

Reply via email to