It uses the MVC design pattern for a Swing GUI, and Java Threads for making the GUI responsive. you can find a screenshot and collaborators at the end of the file.
This object-oriented Traffic Simulator works with several models of vehicles, roads and junctions. You can test different junction policies in three different styles: "batch", "gui", "race" The simulator maintains a collection of simulated objects (vehicles on roads connected by junctions); and a discrete time counter that is incremented in a loop while performing the following operations:
-
Process pre-scheduled events that can add or alter simulated objects. Many example report files can be found at resources folder .Event example:
[vehicle_report] id = v1 time = 5 speed = 20 kilometrage = 60 faulty = 0 location = (r1,30)
-
Advance the state of currently simulated objects, according to their behaviors. For example, vehicles will advance if the road ahead is clear, but will have to stop and wait for red traffic lights.
-
Report on the current state of the simulated objects using the GUI
- Carlos Bilbao <cbilbao@ucm.com>
- Álvaro Lopez <https://github.com/KillerKing18>
This project is licensed under the GNU-GPL License - see the LICENSE.md file for details