Hi,

        I'm using Jess 5.0 and I have some problems with the rules activations.

I am programming intelligent (cooperatiNG) Agents in/with Jess. For the
moment, an agent is a jess Console "batching" some behaviours Jess files. 

--------------
REQUISIT :
--------------

Therefore I need a rule for :
1) assuring at least one rule is active (minimal behaviour)
2) checking REGULARLY if there is some message in one's agent Mailbox
3) enforce REGULARLY some (test ) value based on time. For exemple if I
want my agent
        to wait for 20 seconds for new messages WITHOUT blocking the other rules
firing.

Using strategy breadth enabling a "multi-tasking" rule behaviour... and
avoiding

--------------
CONTEXT :
--------------


Therefore I used a rule as follows: 

(defrule cycle
 ?f <- (cycle ?num)
=>
 (retract ?f)
 (if < check for message >
  then
     (assert (message <get the message> ) )
 ) ; end if
 (assert (boucle (+ ?num 1) ) ) ; ?num used for debuging ... 
)

Alas, depending on when the rules is loaded, rules depending on (cycle ?) 
to enforce some test (mostly temporal) (test <constraint>) where
deactivated then reactivated but never fired as cycle was always modifying
the fact-id.

Therefore, rather than playing with the organisation of the rules I
developped 2 rules :

(defrule cycle
?f <- (cycle ?)
=>
 <message management>
(assert (boucle (+ ?num 1) ) )
(assert (retract-f ?f))
)

and a rule
(defrule retract-fact
 ?f2 <- (retract-f ?f1)
=>
 (retract ?f1 ?f2)
)

..
The solution I admit is rather tricky and not really neat but I used the
fact that
rules depending on (cycle) would fire BEFORE the retract-fact rule as
specified by
the breadth strategy.

But this may have (sic) resulted in some Overhead in the rule management,
but worse
do not work with Jess5. Although some rules are scheduled for activation
they are not
immediately activated and the firing behaviour becomes quite strange as if
Jess forgot
about my rules and some time after recalled to fire it,... 

I was wondering if this was due to the new implementation of the strategy
class as it
is now based (if I am correct) on the time of assertion of the rule
activation ...

So finally is my humble request :

--------------
QUESTION :
--------------

Does anyone encountered some pb with the new strategy implementation (ie
since jess44) and
if not, does anyone has a neat solution for my 3 points requirement
described above
(REQUISIT)...

SOrry for the length of the mail but I wanted to give a good picture of the
pb (not sure if I succeded...).

Thanks for any answer or even clue ...

        Erwan Tranvouez
====================================
Erwan TRANVOUEZ
_______
E-mail: [EMAIL PROTECTED]
URL: http://www.chez.com/~etranvouez            
____________________________________
Telephone Personnel/Personal Phone Number

04 42 89 17 12


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