RE: [jade-develop] Processing ACLMessages with multiple behaviour engagingsame performative ?


Subject: RE: [jade-develop] Processing ACLMessages with multiple behaviour engagingsame performative ?
From: Caire Giovanni (Giovanni.Caire@TILAB.COM)
Date: Tue Jan 07 2003 - 12:31:17 MET


Hi,
 
The receive() method removes a message from the Agent message queue. Therefore the message is no longer there after the first behaviour has received (i.e. picked up from the queue) it.
You can put the message back into the queue using the putBack() method of the Agent class.
However if you have different behaviour that can receive() the same type of message typically your design is wrong. A good practice is to have different behaviours receiving messages matching different (and non overlapping) MessageTemplates.
 
Bye
 
Giovanni
-----Original Message-----
From: David [mailto:amdawong@starhub.net.sg]
Sent: giovedì 2 gennaio 2003 9.00
To: 'JADE'
Subject: [jade-develop] Processing ACLMessages with multiple behaviour engagingsame performative ?

Hi Jaders,
 
It seems that I have some problem doing the above mention.
I have an Agent A. Agent has several behaviours namely Behaviour A, Behaviour B and Behaviour C.
 
All these Behaviours A, B and C listen for messages of the same performative INFORM.
 
ACLMessage received = myAgent.receive(MessageTemplate.MatchPerformative(ACLMessage.INFORM));
 
It seems that only behaviour gets to listen to the message. As soon as one of the behaviours receive the message,
They do certain processing to the message and send it out again. The other 2 behaviour listening for the same type of message
do not get to receive the message.
 
Are my codes the problem ? or is it something in JADE that I do not know that I can enable all 3 behvaiours of one agent listen and receive the same message.?
 
Please advise.
 
 
Regards
 

Hi,
 
The receive() method removes a message from the Agent message queue. Therefore the message is no longer there after the first behaviour has received (i.e. picked up from the queue) it.
You can put the message back into the queue using the putBack() method of the Agent class.
However if you have different behaviour that can receive() the same type of message typically your design is wrong. A good practice is to have different behaviours receiving messages matching different (and non overlapping) MessageTemplates.
 
Bye
 
Giovanni 
-----Original Message-----
From: David [mailto:amdawong@starhub.net.sg]
Sent: giovedì 2 gennaio 2003 9.00
To: 'JADE'
Subject: [jade-develop] Processing ACLMessages with multiple behaviour engagingsame performative ?

Hi Jaders,

 

It seems that I have some problem doing the above mention.

I have an Agent A. Agent has several behaviours namely Behaviour A, Behaviour B and Behaviour C.

 

All these Behaviours A, B and C listen for messages of the same performative INFORM.

 

ACLMessage received = myAgent.receive(MessageTemplate.MatchPerformative(ACLMessage.INFORM));

 

It seems that only behaviour gets to listen to the message. As soon as one of the behaviours receive the message,

They do certain processing to the message and send it out again. The other 2 behaviour listening for the same type of message

do not get to receive the message.

 

Are my codes the problem ? or is it something in JADE that I do not know that I can enable all 3 behvaiours of one agent listen and receive the same message.?

 

Please advise.

 

 

Regards

 



This archive was generated by hypermail 2a22 : Tue Jan 07 2003 - 12:31:23 MET