Designing agent interaction: an overview
Overview
define the speech act protocol
Agents use a set of protocols to communicate. The main protocol is the communicative or speech act.
There are several main groups of speech acts: these include
If the content of your message is "1", you must first decide which type of speech act to use.
For your example the most obvious example is to use a directive speech acts such as a (FIPA) request. Then A requests that b perform some map action to convert 1 to "one" etc. B can then use an assertive type of speech act to reply to the request and inform A of the result of the action is "one".
I bypass the use of interacting protocols for the moment.
define a shared dictionary of terms
The next task is to define a shared dictionary of terms such as the map action, map input and map output (this is called an ontology) a simple way to do this is to structure your content as a list of field value pairs such as
Action=map
Input=1
Output=one
You would probably store this so that both agents could access this ontology.
Note the structure of the content could be the same for both the request and inform.
In the request the output field may be left blank. The meaning of the action is determined by the speech act.
You could implement this in Java using the Properties object. Another way to structure to the content is to use XML / RDF etc.
define message handlers and message generators
You then need to define agent A to loop around generate request type speech acts. Each request would probably take data from some list (file, array, stream whatever).
The other agent B would need to define a message handler for a received message request. This message handler would perform the map action and then generate an inform message reply. See the PingAgent on how to do this.
Here's an example ACL message
(request
:sender: agentA@address
:receiver: agentb@address
:content: (
Action=map
Input=1
Output=unknown)
:reply-with: map
:language: ASCII
:ontology: map
:conversation-id: map1
)
Subsequent requests should use a different conversation id