Subject: RE: [jade-develop] behaviour that cleans up non processable ACLMessages.
From: Caire Giovanni (Giovanni.Caire@TILAB.COM)
Date: Fri Sep 13 2002 - 10:08:26 MET DST
Hi Chris,
Currently there is no way to assign priority to behaviours. It is something we are considering to introduce, but I cannot say when.
In the meantime it is quite easy to implement a behaviour that gets only messages that are not interesting for any other behaviour:
public void action() {
ACLMessage msg = myAgent.receive();
if (msg != null) {
if (NOT already received) {
// Give other behaviours a chance to process this message
myAgent.postMessage(msg);
Store the message in a list of "already-received" messages
}
else {
// No other behaviour has processed this message -->
Handle the message (e.g. reply with NOT_UNDERSTOOD)
Remove the message from the list of "already-received" messages
}
}
block();
}
Just pay attention to subBeahviours of compositeBehaviours.
Bye
Giovanni
-----Original Message-----
From: Chris van Aart [mailto:aart@swi.psy.uva.nl]
Sent: giovedì 12 settembre 2002 16.49
To: jade-develop@sharon.cselt.it
Subject: [jade-develop] behaviour that cleans up non processable
ACLMessages.
Hi Guys,
When having two agents, A and B communicate with eachother, I instantiate
a behaviour for every conversation.
These behaviour listen on the "incoming message queue" with the use of a
MessageTemplate.
For example, the MessageTemplate will look at a the conversation-id and
the in-reply-to attribute.
What I want to do is: when agent C sends a message that my agent cannot
process, the agent should generate a NOT-UNDERSTOOD message. Furthermore,
if agent B sends a message in an existing conversation with not all
attributes filled, the agent should generate a FAILURE message.
For this I could generate a behaviour that listen to all incoming messages
and looks at all incoming messages.
The problem is that this behaviour will also try to process messages that
should be processed by other behaviour that listen to existing behaviours.
Is there a way to give behaviours a priority? So, behaviours that listen
on conversation are on top, in the middle behaviours that can trigger new
conversations and below a behaviour that "cleans up the mess".
thanks,
Chris
_______________________________________________
jade-develop mailing list
jade-develop@sharon.cselt.it
http://sharon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT http://jade.cselt.it/mailing.htm#unsubscribe
This archive was generated by hypermail 2a22 : Fri Sep 13 2002 - 10:09:12 MET DST