Hi,
I thought the question was more related with putting the engine to run.
I guess that after each modify a (run) must be invoked.
What about (run-until-halt)? Will rules be evaluated in every working
memory update? What if the time fact update is faster than the
"activation semaphore": would the first modify be lost (in which rules
firing on it is concerned)?
Henrique
Ernest Friedman-Hill wrote:
On May 8, 2008, at 10:03 AM, ivo jonker wrote:
I see. That sounds good.
Does this mean Jess automatically evaluates the rules when i call the
Modify for every second i update the Time?
Pattern matching is driven by working memory changes, and it's very
smart about what to re-test. That's the whole point of the "Rete
algorithm" on which Jess is ultimately based. When the time is
updated, patterns that check the time in some way may be re-evaluated.
Jess does the minimum possible amount of computation.
2008/5/8 Ernest Friedman-Hill <[EMAIL PROTECTED]>:
On May 8, 2008, at 9:24 AM, ivo jonker wrote:
Thanks a lot, this is exactly what i was looking for.
I've just ordered the book: Jess in action and it should arrive
shortly. I'm looking forward to it and i know it will be usefull.
Anyway, while i'm at it. I was wondering how JESS would be suitable
for using Time as a fact. I believe jess is not able to respond 100%
real-time, so i guess it's useless using time as a fact when testing
for changes into seconds... I might be wrong though.
It works fairly well, actually. You have a fact like
(time (seconds 87268726))
and then have a thread, either written in Java or in Jess, which
keeps a reference to this Fact object and uses Rete.modify() or
(modify) to update the "seconds" slot periodically. Then your rules
can just match that slot however they like and when the fact is
updated the matches are evaluated.
--------------------------------------------------------------------
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]
--------------------------------------------------------------------