next up previous contents
Next: startUser() Up: Extending the basic Agent Previous: Extending the basic Agent   Contents

initUser()

This method is called once when initializing the Agent. This is done at the very beginning of the lifetime of the Agent. Here is the place to put code to initialize the new Agent. This method has the same intention as a constructor and the code should be inserted here instead in the constructor. The constructor has a hard timeout when instantiating the Agent and when this time is exceeded, the Agent will not be started in the Agent System. Normally the constructor should be empty for this reason. A developer should also insert here the first command to execute when being started. This will be described later.

The initUser method could have for example the following content:

setNextCommand(``moveMe'');

helper.println(``Init called...'');

The moveMe command is added to the command queue to be executed when started the Agent. It then uses the println method of its helper to print a status message on the screen.


next up previous contents
Next: startUser() Up: Extending the basic Agent Previous: Extending the basic Agent   Contents
Thomas Letsch 2001-02-21