Running the Traffic Simulation System
As mentioned in the tutorials, the simulation host and the visualization and editing system are totally decoupled in DIVAs. Both components reside on isolated execution environments running on the same host machine. This approach allows for multiple concurrent visualizations providing multiple perspectives of a single simulation, and multiple concurrent users interactions.
To start the simulation:
First, we start the simulation service. This is done by: Right click the class “TrafficMain.java” > Run As > Java Application
As we can see in the follwing figure that shows the console, the traffic simulation is created and initialized to be run at the localhost with the IP address 0.0.0.0 using the port 24555. Also, the default environment is loaded into the simulation.
Once the simulation is running, we start the simulation GUI and we connect to the simulation. This is done by:
- Right click the class “TrafficGui.java” > Run As > Java Application
- On the pop-up window, make sure to set the connection type tp “local” and the “Port” to “24555”.
- Press “Connect”
Now, a connection is esatblished between the GUI and the simulation service. We can control the simulation using the GUI panel. For instance, we can run the simulation byh pressing the “Run Simulation” button.
The simulation status is also displayed on the GUI to show useful information to the user as illustrated in the following figure: