95 | | This figure highlights the main components of the system and also illustrates the communication between them. |
96 | | First, we have the master of the application which waits agents to join the platform and creates the channels of communication with them. Also, the master sends to each agent the information necessary for gaining access to the corresponding channels and for creating the sensors and the actuators. |
| 101 | === a) Engine === |
| 102 | |
| 103 | The Engine is the one responsible for running the environment simulation, running the agents and communicating with the GUI. It runs a master thread and multiple slave threads. The Engine is ran on the cluster. |
| 104 | |
| 105 | Each slave thread runs an agent. Each agent interacts with the environment through sensors and actuators. The sensors are the ones notifying the agent of changes in the environment, while the actuators, after being updated by the agent to reflect the action it wants to take, act on the environment. |
| 106 | |
| 107 | Each sensor (actuator) entity contains a provider and the actual sensor (actuator) of the agent. The provider is the component executed by the master and will update the sensor (respectively, it will receive the action wanted by the agent). The communication between the master and the agents is done through channels between the sensor / actuator and its associated provider. |
| 108 | |
| 109 | The master thread will first set up the simulation by creating the environment, waiting for all agents to register and creating the channels of communication with these agents. Also, the master sends to each agent the information necessary for gaining access to the corresponding channels and for creating the sensors and the actuators. For each step of the simulation, the master will first update all sensor providers, which send the new data to the agents. The master will wait for the agents' responses. The received actuators will then be applied on the environment. The changes made to the environment are sent to the GUI. |
| 110 | |
| 111 | The Engine contains a component to which we will refer as the remote GUI. This is the component that communicates with the GUI, by sending all the environment data necessary for drawing a frame, like the object positions, etc. |
| 112 | |
| 113 | === b) GUI === |
| 114 | |
| 115 | The GUI is ran locally. It displays the environment simulation and allows the user to control this simulation. For each frame, it asks the Engine for the new environment data. The Engine executes a step and then sends the new environment data to the GUI. |