I do not think that you can make the rule engine wait for a condition. Rules
fire when conditions are satisfied. If your objective is not to fire the rule if
"cond 2" happens later that 5 seconds, then you can introducing a timestamp
associated with your condition Then your rule would be:

(defrule r1
  (cond_1)
  (cond_2)
  (bind ?diff (- ?time_of_cond_2 ?time_of_cond_1))
  (test (<  ?diff  5 ))

   =>  (action)
)







"Matthias Blankenhaus" <[EMAIL PROTECTED]> on 04/16/2001 04:51:25 PM

Please respond to "Matthias Blankenhaus" <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:

Subject:  JESS: temporal reasoning



Hello !

Is there a way to implement temporal reasoning in Jess ? E.g.

(defrule r1
  (cond 1)
  (cond 2, wait 5)  ;; wait at most 5 sec for cond, if it does not
              ;; occur than jump out of this rule
   =>  (action)     ;; else perform the action part
)



Matthias

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

Reply via email to