RE: [jade-develop] Processing ACLMessages with multiplebehaviourengagingsame performative ?


Subject: RE: [jade-develop] Processing ACLMessages with multiplebehaviourengagingsame performative ?
From: Caire Giovanni (Giovanni.Caire@TILAB.COM)
Date: Wed Feb 05 2003 - 13:56:02 MET


Hi,
 
First of all I would suggest checking with the Introspector agent (using the step-by-step mode) what actually happens to your behaviours. In fact it is quite strange that the same AchieveRE is re-scheduled before the other ones.
 
As possible solutions I would say:
1) You can "divide" your ontology registering it several times with different names where name1 corresponds to a given set of actions, name2 corresponds to another set of actions ....
In this way you can have non-overlapping message templates.
2) You can define your own message template that parses the content (this is an elegan solution, but it is not performant as, unless you do some tricks, you have to parse the content 2 times).
3) You can adopt a different approach with a "DispatcherBehaviour" that gets all possible messages and dispatches them to actual executors/responders that do not have to receive messages anymore.
 
Hope this helps,
 
Giovanni
-----Original Message-----
From: Thies, Peter [mailto:Peter.Thies@iao.fhg.de]
Sent: mercoledì 5 febbraio 2003 13.44
To: Caire Giovanni; amdawong@starhub.net.sg; JADE
Subject: AW: [jade-develop] Processing ACLMessages with multiplebehaviourengagingsame performative ?

Hi,
 
I have some similar problem and would be grateful if anybody could help me.
 
I am using the AchieveRE "protocol" resulting in the well-known 3-step process (request, aggree, inform). I have implemented an agent, let's call him service provider, offering several services. This results in using several subclasses of AchieveREResponder. As our project is constrained to one complex ontology only, we cannot make use of MessageTemplates for dispatching incoming requests to the appropriate AchieveREResponder. Alle Responder have to share the same MessageTemplate. As the content transmitted is quite complex, we have to extract that content within the prepareResponse methode of one responder, have a look at it and if it doesn't fit, put it back (putBack method) to the queue, hoping that the scheduler will find some better AchieveREResponder.
 
This doesn't work. The putBack method seems to work because it completes. Our prepareResponse returns null. But instead of calling another Responder then the Scheduler obviously calls the same Responder again and again.
 
Can you give me some advice?
 
Thanks in advance
 
Peter
____________________________________________
Peter Thies
Fraunhofer IAO
Nobelstr. 12
D-70569 Stuttgart

Tel.: +49(0)711/970-2347
Fax: +49(0)711/970-2300
E-Mail: Peter.Thies@iao.fhg.de

http://www.mensch-und-computer.de/mc2003/
-----Ursprüngliche Nachricht-----
Von: Caire Giovanni [mailto:Giovanni.Caire@TILAB.COM]
Gesendet: Dienstag, 7. Januar 2003 12:31
An: amdawong@starhub.net.sg; JADE
Betreff: RE: [jade-develop] Processing ACLMessages with multiple behaviourengagingsame performative ?

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
 

Nachricht

Hi,
 
First of all I would suggest checking with the Introspector agent (using the step-by-step mode) what actually happens to your behaviours. In fact it is quite strange that the same AchieveRE is re-scheduled before the other ones.
 
As possible solutions I would say:
1) You can "divide" your ontology registering it several times with different names where name1 corresponds to a given set of actions, name2 corresponds to another set of actions ....
In this way you can have non-overlapping message templates.
2) You can define your own message template that parses the content (this is an elegan solution, but it is not performant as, unless you do some tricks, you have to parse the content 2 times).
3) You can adopt a different approach with a "DispatcherBehaviour" that gets all possible messages and dispatches them to actual executors/responders that do not have to receive messages anymore. 
 
Hope this helps,
 
Giovanni
-----Original Message-----
From: Thies, Peter [mailto:Peter.Thies@iao.fhg.de]
Sent: mercoledì 5 febbraio 2003 13.44
To: Caire Giovanni; amdawong@starhub.net.sg; JADE
Subject: AW: [jade-develop] Processing ACLMessages with multiplebehaviourengagingsame performative ?

Hi,
 
I have some similar problem and would be grateful if anybody could help me.
 
I am using the AchieveRE "protocol" resulting in the well-known 3-step process (request, aggree, inform). I have implemented an agent, let's call him service provider, offering several services. This results in using several subclasses of AchieveREResponder. As our project is constrained to one complex ontology only, we cannot make use of MessageTemplates for dispatching incoming requests to the appropriate AchieveREResponder. Alle Responder have to share the same MessageTemplate. As the content transmitted is quite complex, we have to extract that content within the prepareResponse methode of one responder, have a look at it and if it doesn't fit, put it back (putBack method) to the queue, hoping that the scheduler will find some better AchieveREResponder.
 
This doesn't work. The putBack method seems to work because it completes. Our prepareResponse returns null. But instead of calling another Responder then the Scheduler obviously calls the same Responder again and again.
 
Can you give me some advice?
 
Thanks in advance
 
Peter

____________________________________________
Peter Thies
Fraunhofer IAO
Nobelstr. 12
D-70569 Stuttgart

Tel.:   +49(0)711/970-2347
Fax:    +49(0)711/970-2300
E-Mail: Peter.Thies@iao.fhg.de

http://www.mensch-und-computer.de/mc2003/

-----Ursprüngliche Nachricht-----
Von: Caire Giovanni [mailto:Giovanni.Caire@TILAB.COM]
Gesendet: Dienstag, 7. Januar 2003 12:31
An: amdawong@starhub.net.sg; JADE
Betreff: RE: [jade-develop] Processing ACLMessages with multiple behaviourengagingsame performative ?

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 : Wed Feb 05 2003 - 13:58:38 MET