What is MST?
According to Wikipedia, “traffic simulation is a mathematical modeling of transportation systems that uses software to help plan, design, and operate transportation systems.” Traffic simulation models are especially useful for infrastructure management, both urban (cities) and interurban (highways), helping authorities provide answers to essential planning questions: Should we install traffic lights at this intersection? Is it better to put a roundabout? Where is the best place to install a speed camera? And not only at the planning level, but also in terms of implementation: In case of an accident on the city’s main street, how should we reroute traffic? Is it safe to close street X to city traffic? What is the best strategy for when all the vehicles leave Camp Nou on a match day?
What is SUMO?
Once the reasons why a traffic simulation model can be useful have been established, a critical question arises in any project in this field: Which tool to choose? The market offers a wide range of options, and with a bit of attention, gems like the Eclipse SUMO project stand out above the rest because it goes beyond being just another tool.
Eclipse SUMO is an open-source project led by the German Aerospace Center (DLR) that began in 2001 and involves about 10 people. Despite operating in a highly competitive market alongside tools like Aimsun or PTV’s Vissim/Vissum, it has managed to carve out a niche with the support of an actively participating development community. They also organize an annual conference where they accept scientific articles from the community and provide a platform to present the work done.
But how is it used?
Before making decisions about roads and cities, it’s important to have the roads and cities we’re working with. When installing SUMO, it includes a CLI tool called OSMWebWizard that allows us to create our network. In this configurator, we can choose not only practically any scenario in the country, but also select the types of roads we want (main roads, secondary roads, service roads, etc.), which entities we want to participate in our scenario (cars, trucks, bicycles, pedestrians), and how long we want the simulation to last.
Once we have entered and confirmed all our preferences, we can then complete the wizard process and proceed to the configuration and execution of the scenario.
It is important to emphasize that behind each decision made, there is a significant theoretical foundation and that, in general, in traffic simulation, no decision is taken lightly or is trivial. In this regard, demand management—which refers to the entities participating in the system traveling from point A to point B (cars, people, trams)—is a very extensive topic and is beyond the scope of this article.
Network tinkering
The previous process should leave us with a directory containing all the files needed to run the simulation. The file with the .sumocfg extension can now be opened with the ‘sumo-gui’ program, where we will see our network loaded for the first time, along with a play button that immediately catches the eye. By clicking it, we can watch how the different cars, as well as pedestrians and other entities if specified, move through the network. Congratulations, you have your first simulation!
It is very likely that the network still has some errors: poorly connected roads, traffic lights in the wrong places, disconnected lanes, etc. Unfortunately for people working in the field, there is not yet a magic tool that fixes all these problems, so manual intervention is necessary. To do this, within sumo-gui itself, go to the ‘Edit/Open Sumo config in netedit’ section.
This tool allows us to add and remove lanes, add vehicle counting points (loops), set speed limits for specific sections, control traffic light plans, manage demand, among other options. For the more curious, this means hours of testing all available configuration combinations, and for the more theoretical, it offers the possibility to customize an entire scenario in almost every detail from scratch.
Programmer-oriented
The requirements of personal, academic, and professional projects are diverse, and configuring a static network may not be enough. That’s why SUMO provides an interface in the form of a Python library to interact with the simulation in real time. This tool is called Traffic Control Interface (or TRACI) and comes with documentation detailing all available options for developers.
SUMO installation includes a series of tutorials, some of which use the library, such as TraCI 4 Traffic Lights https://sumo.dlr.de/docs/Tutorials/TraCI4Traffic_Lights.html, which allows exploring how to modify traffic light plans directly from the interface.
Conclusions
SUMO is marking a turning point in traffic simulation, being the main open-source reference and setting the pace for the entire sector. Although it still lags behind some commercial software in certain aspects, the strength of a solid community behind it will help it reach places it hasn’t yet, boldly shaping the future progress of traffic simulation. It’s a tool we highly recommend keeping a close eye on!