back to API     back to index     back to guided tour index     prev     next  

Mobile agents

This example shows a set of mobile agents moving around while still communicating with their base and with each other. It also features the capability to move a swing window between screens while moving an agent from one JVM to the other.

1. start the penguin application

using the penguin script.

2. start IC2D to see what is going on

using the ic2d script

acquire the machines you have started nodes on

3. add an agent

- on the Advanced Penguin Controller window : button "add agent"

an agent is materialized by a picture in a java window.

- select it, and press button "start"

- observe that the active object is moving between the machines, and that the penguin window disappears and reappears on the screen associated with the new JVM.

4. add several agents

after selecting them, use the buttons to :

- communicate with them ("chained calls")

- start, stop, resume them

- trigger a communication between them ("call another agent")

5. move the control window to another user

- start a node on a different computer, using another screen and keyboard

- monitor the corresponding JVM with IC2D

- drag-and-drop the active object "AdvancedPenguinController" with IC2D into the newly created JVM : the control window will appear on the other computer and its user can now control the penguins application.

- still with IC2D, doing a drag-and-drop back to the original JVM, you will be able to get back the window, and control yourself the application.