Subject: RE: [jade-develop] Mapping of AgentAction in message to AgentAction trigger
From: Caire Giovanni (Giovanni.Caire@TILAB.COM)
Date: Mon Sep 16 2002 - 10:27:10 MET DST
Hi,
You can have a behaviour receiving REQUEST messages. This behaviour embeds a Map mapping agentaction names to objects implementing an "Executor" interface with the method
public void execute(AgentAction act) {
}
The Map is filled with a method
registerExecutor(String actionName, Executor exec);
When the behaviour receives a REQUEST message it extracts the action, retrieves the Executor for that action and calls its execute method.
Alternatively you can use Java reflection and map action names with Method objects and, when a message arrives, call the invoke() method on the proper Method object.
Another approach could be to embedd the execute() method in the AgentAction objects themselves.
I.e. when the behaviour receives the REQUEST message and extracts the AgentAction object, it casts that object to "Executor" and calls its execute() method.
Bye
Giovanni
-----Original Message-----
From: Chris van Aart [mailto:aart@swi.psy.uva.nl]
Sent: domenica 15 settembre 2002 15.36
To: jade-develop@sharon.cselt.it
Subject: [jade-develop] Mapping of AgentAction in message to AgentAction
trigger
Hi Guys,
Does anyone of you have a mechanism for triggering actions when receiving
a message containing an AgentAction?
I heard that in, yet another agent toolkit, there is a table of written
agentactions (the agentactions in messages) which maps to methods.
The idea is that wen the agents recieves a REQUEST containing an
agentaction, it would not only map it to the corresponding object, but
would also trigger a method (like an execute) at that object.
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 : Mon Sep 16 2002 - 10:27:21 MET DST