Unwanted recursive behavior in sequential behaviours

View: New views
1 Messages — Rating Filter:   Alert me  

Unwanted recursive behavior in sequential behaviours

by Aalhad Deshmukh-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Jaders,
 
I have a set of sequential behaviours which are to be executed on receiving a message.
 
On the last seq.addSubBehaviour I resend the same message back to the same agent. This is done so as to form a loop.
 
However, this results in a recursive sort of behaviour and the agent is unable to receive any other messages from other agents.
 
I was expecting the agent to receive any message that was sent to it (even when it send the same message back to itself in that particular message response).
 
Can you please explain why this behaviour is occuring?
 
 
eg: Roughly the code goes like this
 
ACLMessage msg = receive(messageTemplate1);
 
if( msg != null)
 
{
    sequential behavior seq.
    seq.addSubBehaviour(1)
    seq.addSubBehaviour(2)
     .....
and inside subBehaviour2 I resend message matching messageTemplate1
 
 
so at this point....System.out.println("THIS IS NEVER PRINTED");
and no other message is received by the agent
}
 
Thank you
 
Aalhad

_______________________________________________
jade-develop mailing list
jade-develop@...
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm
LightInTheBox - Buy quality products at wholesale price