Home Overview The Background System
Agent.GUI Background System - Conducting complex and comprehensive simulations on distributed machines Print option in slimbox / lytebox? (info) E-mail

The Agent.GUI background system allows enhancing a running JADE-based Multi-Agent system on the fly. Here, enhancing means that the Agent.GUI end user application, for example, is already running on a computer but it can already be imagined that the expected application needs will exceed the capacity of the local computer. The solution is obvious: Distribute your simulation over further machines (computers) in your private network by using the Agent.GUI background system.

 
How is the Background system structured?

The system consists of the main components server.master, server.slave and server.client. The following image shows in the yellow area the organisational structure of these representatives, which are in fact running JADE agents.

As can be seen from the image a JADE platform can only be extended if control over remote systems is given. If so, a new JADE instance can be started on site by laying down the appropriate parameter set for Classpath, host, port, needed JADE-service and so on. As a result the new JADE instance will be connected to the running platform. In order to allow such an automatic platform extension, the background system uses the following three types of agents:

server.master: This agent has the overview of all involved machines and will store and update this information in the database. Every other background agent has to register itself at the server.master and regularly reports the state (general information, current load and so on) of the corresponding machine to it. If an additional remote container is required, the server.master will handle such requests.

server.slave: A server.slave is a passively waiting agent running on a different machine in a computer network. If requested from the server.master, it will start a new Java process with a new JADE instance, which will run as a remote container. Furthermore, it regularly reports the current system load to the server.master.

server.client: This agent is running on the platform, which will be started through the end user application of Agent.GUI. If a running platform needs more calculating power for an application or a simulation, the server.client will forward such requests to the server.master by using an instance of a ClientRemoteContainerRequest (see API for more information).
 

Configure the background system - Introductory remark

The configuration steps, which are described below, can also be carried out on one single machine. Therefore Agent.GUI can be executed on one machine several times, so that it is possible to let a server.master and a server.slave module run concurrently, while simultaneously running the end user application of Agent.GUI as well. Just keep in mind, that you can configure an Agent.GUI instance during runtime from application mode to server mode and the other way round.
 

Configure the background system

1. Create the required MySQL database: Make sure that an appropriate MySQL database server is available in the underlying network and grant access for a user who is allowed to create a new database. The needed table structure will be created automatically the first time you start a server.master (if required access rights can be restricted after the creation process). If the creation of the database was successful the following lines will appear on the application console (see bullet point no. 2): 

    Creating the database for the Server.Master ...
    Database created successfully!
 

2. Run the server.master: Start the AgentGui.jar on the system of your choice and navigate to 'Extras' => 'Options'. There, the 'Server'-option needs to be selected in order to change the execution mode of Agent.GUI from an end user 'Application' to a 'Server' module of the background system. Further configurations are required for the URLs or the IP-Addresses of the server.master module and the underlying database. These configurations will be stored in the file agentgui.ini, which can be found in the folder ./AgentGUI/properties/. 

The port configuration shown in the image above is the default setting, which is also used as default for JADE. We recommend to just configure the URL or IP-Address here, which should be the public known name of the local machine in your network (do not use ‘localhost’ here). If Agent.GUI starts as a server-system it will notice by its own, that it was executed on that specified machine and will automatically switch to the server.master mode. 
If the configuration has been set and confirmed by pressing OK, the application window will disappear and only the Tray-Icon will remain as visible part of Agent.GUI. Pressing the right mouse button on this Tray-Icon will cause a context menu to appear, which allows again opening the option dialog or the console window (see image on the right).
 

3. Run the needed number of server.slaves on further machines: The configuration of a server.slave is similar to the configuration of the server.master, but it requires just the right URL/IP and the configured ports of the server.master module. Similarly, and as described above, if Agent.GUI starts as a server-system it will notice by its own, that it was not executed on that specified machine and will automatically switch to the server.slave mode. It has to be ensured that a server.master is running in order to allow the server.slave tor register there.
 

4. Configure your Agent.GUI application on your personal system: To do this setting is the same as described above. Set the URL/IP of the server.master, including the correct ports, and press OK - that’s it.
 

Test the background system

1. Create a new project in the Agent.GUI end user application

2. Make sure that the following services are selected for the JADE-Configuration (actually this is the default selection):
    a. agentgui.simulationService.LoadService
    b. agentgui.simulationService.SimulationService
    c. jade.core.event.NotificationService
    d. jade.core.mobility.AgentMobilityService

3. Just start JADE by pressing the green J in the toolbar, so that the rma-agent of JADE will appear.

4. Select the Main-Container and press ‘Start new Agent’, than search for the class name 'agentgui.simulationService.agents.example.RemoteStarterAgent' and set the agent name. If server.master and server.slave are running correctly, a new remote container should be added to the platform, which can be recognized by a new folder in the rma-agent and a newly appearing rma-agent (if configured so).

5. The agent which was used to start a new remote container will fall into the suspend-mode after it started a new container. In order to start a second remote container the agent needs to be awakened again by using the resume button in the GUI of rma-agent.
 

Test the remote debugging ability of Agent.GUI

In order to show how the console output of a remote container can be accessed we would like to take the opportunity and extend the test of the background system now. Starting from point no. 5 above, just do the following:

6. Stop JADE by pressing the red J button in the toolbar of the Agent.GUI application window.

7. Go back to the JADE-Configuration again and move the following service to list of selected services:
    e. jade.debugging.DebugService

8. Open the console, by using the 'Show/Hide console' functionality either in the menu 'View' or in the toolbar.

9. Start JADE again and repeat also the steps 4 and 5. If a new remote container joins the current platform the console window should get new tabs, which are titled with respective containers name.

10. Start another Agent by using the Class 'agentgui.simulationService.agents.example.SystemOutAgent'. This agent will send some output to the console every 5 seconds.

11. Select the newly started agent and use the context menu in order to use the 'Migrate Agent' functionality and move the agent to a different container. Just type the corresponding name of the container in the appearing dialog box and press ‘OK’.

12. Have a look at the console tabs of the Agent.GUI application window. 


 

Synchronized time in distributed systems

As final test, we would like to introduce the feature of synchronized time now, which comes with the SimulationService of Agent.GUI. Therefore:
13. As described in bullet no. 4, just start the following agent on your local machine twice: 
      agentgui.simulationService.agents.example.ASynchTimeTestAgent

14.  Migrate one of theses agents to a remote container, where it should appear on the screen now and show the local and the synchronized time.

 
Joomla templates by a4joomla