Subject: Re: [jade-develop] behaviours
From: Alexander Osherenko (a.ocherenko@gmx.de)
Date: Tue Oct 01 2002 - 15:02:17 MET DST
Giovanni,
is it possible to match the content of the message? The performative is not enough. In our system we have several requests and must check if we got a message with specific contents.
We've tried to use the receive method, but the system is working very slow. That's why we've chosen the blockingReceive method.
Cheers
Alexander
----- Original Message -----
From: Caire Giovanni
To: Alexander Osherenko ; JADE
Sent: Tuesday, October 01, 2002 12:18 PM
Subject: RE: [jade-develop] behaviours
Hi,
You can use proper MessageTemplates to specify which messages a behaviour should read from the MessageQueue.
Moreover please take into account that calling blockingReceive() from within a behaviour is not recommended as this blocks the whole agent (also other behaviours).
Bye
Giovanni
-----Original Message-----
From: Alexander Osherenko [mailto:a.ocherenko@gmx.de]
Sent: marted́ 1 ottobre 2002 11.50
To: JADE
Subject: [jade-develop] behaviours
Hello,
how could I solve the problem of forwarding messages if I have several behaviours that call the blockingReceive method and each behaviour waits for a specific message?
For example:
class Behaviour1 {
...
void action() {
ACLMessage msg = blockingReceive();
...
if (messageToken instanceof dummy1) {
....
}
}
}
class Behaviour2 {
...
void action() {
ACLMessage msg = blockingReceive();
...
if (messageToken instanceof dummy2) {
....
}
}
}
The problem is that the original message which is defined for Behaviour2 would be processed by the Behaviour1.
Cheers
Alexander
----- Original Message -----From: Caire GiovanniTo: Alexander Osherenko ; JADESent: Tuesday, October 01, 2002 12:18 PMSubject: RE: [jade-develop] behavioursHi,You can use proper MessageTemplates to specify which messages a behaviour should read from the MessageQueue.Moreover please take into account that calling blockingReceive() from within a behaviour is not recommended as this blocks the whole agent (also other behaviours).ByeGiovanni-----Original Message-----
From: Alexander Osherenko [mailto:a.ocherenko@gmx.de]
Sent: marted́ 1 ottobre 2002 11.50
To: JADE
Subject: [jade-develop] behavioursHello,how could I solve the problem of forwarding messages if I have several behaviours that call the blockingReceive method and each behaviour waits for a specific message?For example:class Behaviour1 {...void action() {ACLMessage msg = blockingReceive();...if (messageToken instanceof dummy1) {....}}}class Behaviour2 {...void action() {ACLMessage msg = blockingReceive();...if (messageToken instanceof dummy2) {....}}}The problem is that the original message which is defined for Behaviour2 would be processed by the Behaviour1.CheersAlexander
This archive was generated by hypermail 2a22 : Tue Oct 01 2002 - 14:53:51 MET DST