Subject: RE: [jade-develop] Handlers
From: Caire Giovanni (Giovanni.Caire@TILAB.COM)
Date: Wed Oct 09 2002 - 09:11:51 MET DST
Hi,
I think it's a good solution.
Note that the jade.proto.states.HandlerSelector class is a ready-made behaviour that does more or less what you have done: It executes different handlers (behaviours) according to a key. It was thought exactly to be registered as a handler in the PREPARE_RESPONSE or PREPARE_RESULT_NOTIFICATION states of an AchieveREBehaviour.
Bye
Giovanni
-----Original Message-----
From: Joan Ametller [mailto:jamet@abra.uab.es]
Sent: martedì 8 ottobre 2002 20.47
To: jade-develop@sharon.cselt.it
Subject: [jade-develop] Handlers
I have a problem and i would like to know if the solution i've thought its
good or there are some more interesitng. Thanks in advanced.
I have An agent A waiting for requests from an agent B. Depending of some
details of the request, the agent must do two diferent actions:
Case1:
Respond with a agree and later an inform message.
Case2:
1. Respond with an agree to agent B
2. Send a request message to an agent C
3. wait for an agree message from C;
4. wait for an inform message from C.
5. Depending from the content of this inform message send a kind of inform or
antoher to B.
To implement this schema i thought that the agent A could have a
AchieveREResponder behaviour with a handler for ResultNotification with two
keys:
One For case 1 that is a OneShotBehaviour that constructs the inform message
One For case 2 that is an AchieveREInitiator who begins the comunication with
agent C and constructs the final inform message to B depending which are the
results of this last conversation.
What do you think about ? think its a good idea ? Thank you very much.
_______________________________________________
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 : Wed Oct 09 2002 - 09:11:57 MET DST