next up previous contents
Next: Creating a System Agent Up: Creating an Agent Previous: Helper   Contents

Example Agent

The example used to describe the use of the methods of the basic Agent and the helper is listed in total in appendix [*] on page [*].

When started the Agent first prints out its registered location. The next method called through the command queue is called moveMe(). This method request the communication service to move the Agent to the given other System. Before calling the move method it sets the next method to call after moving to ``showMe''. When now arrived at the new location the showMe method is called through the command queue. The showMe method prints out the new location of the Agent. Then it queries the MAFFinder for the location of an Agent of the type ``AgentEx3''. If there is such an Agent registered at the MAFFinder the example Agent send a future message to it. The message consists of a call to the method ``Hello'' with parameter the ID of the Agent. Because it is using the FutureMessage it continues executing and queries in a loop if the answer has arrived. When the answer has arrived it prints out how long it has waited for it and what the AgentEx3 returned as response.

With these few tasks the Agent uses almost all functions / services provided by the Agent System. It uses the AgentHelper, the communication service and the MAFFinder. It travels to another System and sends a future message to another Agent. This should make it a good example of the possibilities of the TAgents Mobile Agent System.


next up previous contents
Next: Creating a System Agent Up: Creating an Agent Previous: Helper   Contents
Thomas Letsch 2001-02-21