Implementing an Urban Dynamic Traffic Model

The world of mobility is constantly evolving and proposing new technologies, such as autonomous driving, electromobility, shared-mobility or even new air transport systems. We do not know how people and things will be moving within cities in 30 years, but for sure we know that road network planning and traffic management will remain critical issues. The goal of our research is the implementation of a data-driven micro-simulation traffic model for computing everyday simulations of road traffic in a medium-sized city. A dynamic traffic model is needed in every urban area, we introduce an easy-to-set-up solution for cities that already have traffic sensors installed. Daily traffic flows are created from real data measured by induction loop detectors along the urban roads in Modena. The result of the simulation provides a set of ”snapshots” of the traffic flow within the Modena road network every minute. The main contribution of the implemented model is the ability, starting from traffic punctual information on 400 locations, to provide an overview of traffic intensity on more than 800 km of roads.


INTRODUCTION
Smart cities are full of sensors, with the availability of large amounts of data new simulation challenges are emerging. An area where simulation has been applied for many years is traffic modelling. Efficiently control the traffic flow within a city would be a powerful means for eliminating congestion, to give priority to the emergency vehicles, to decrease traffic incident recovery times, to reduce the emissions caused by vehicles and strengthen the most used connections between the busiest urban areas. All these actions could help in the management of a city and improve the quality of life of its citizens. Moreover, traffic management is the first and essential step to reach the Sustainable Development Goals (SDG) as defined in the Agenda 2030, adopted by all United Nations Member States in 2015 1 and an important analysis towards the Vision Zero 2 , i.e. a highway system with no fatalities or serious injuries involving road traffic.
Data collected from sensors can power simulations used for understanding traffic flow [13]. In this scenario, the large amount of sensor data, as well as the complexity of the road systems, will require Big Data techniques and High-Performance computing.
The goal of this paper is to implement a traffic model for the city of Modena making use of sensor data [1]. The model will be a powerful means for studying traffic flow within the city. This work is the first step of a bigger project: the "TRAFAIR -Understanding Traffic Flow to Improve Air quality" project 3 [11] that is focused on studying traffic flows within cities to estimate the emission of vehicles and the impact on urban air pollution.
Traffic could be modelled in different ways: as a "fluid" moving in the streets or as single "objects" (cars, motorbikes, etc.) with individual trajectories and speeds. The firsts are macro-simulation models, as in [5], where vehicles are not simulated individually but as a flow. While the seconds are micro-simulation models, where the simulation is applied to each vehicle individually. Therefore, this latter model is better to provide information about vehicles emission. Traffic models can also take advantage of GPS data, collected from vehicles in the streets [4] and mobile devices [12]. For public administration, GPS and mobile data are difficult to access and the model they use is often a static traffic model based on traffic demand that can not give them information about the real-time traffic situation in the city.
The paper is organized as follows. Section 2 contains a general description of traffic management in the city of Modena. In Section 3, we describe the simulation model, SUMO, the input required and the output obtained. Section 4 displays some results obtained from a set of traffic simulations. Conclusions and future research direction are sketched in Section 5.

TRAFFIC MODELLING IN MODENA
Modena is a city and provincial capital with 185,000 inhabitants, a geographical extension of 183 square km and an efficient road network of 867.9 km. It is located in the Po valley, an area that, for its morphology, suffers from air pollution-related diseases. Pollution is partially caused by the traffic generated by 120,000 cars 4 circulating in the urban area. Modelling and analyzing the traffic of a city is the first step to develop efficient smart mobility solutions and to mitigate the effects of pollution caused by traffic.
Traffic management solutions typically require the use of simulators able to capture in detail all the particular characteristics and dependencies associated with real-life traffic.
In Italy, Public Administrations make use of traffic models that usually provide information on the peak hours of an average working day of the year. These traffic models do not intend to describe the variation of traffic within the week, but an average, static situation describing an average working day during the peak hours.
An accurate traffic model can be created from data collected from a network of sensors distributed over the area of interest. The costs for the construction of such a distributed network of sensors can be burdensome for Public Administrations. However, in many cities, some distributed sensors are already employed for other purposes. In the city of Modena, around 400 traffic sensors are located near traffic light controlled junctions. These devices are also called induction loop detectors since they can detect vehicles passing or arriving at a certain point through an electrically conducting loop installed in the pavement. In Modena, these sensors were used locally to control the traffic light logic. However, their traffic-related data, the vehicle counts and the average speed, are never been used before. Due to our application of these measurements, it is not relevant which type of detector is used as soon as it can give us information about the number of vehicles and their average speed.
Taking advantage of the information collected from these sensors, we were able to set up a traffic model for the urban area of the city. The simulations are realized by using only open source resources: SUMO (Simulation of Urban Mobility) as the simulation tool and OSM (Open Street Map) as the source of geographical data.

THE MODEL
SUMO 5 (Simulation Of Urban Mobility) is a microscopic, collisionfree, space-continuous and time-discrete simulator as described in [7]. Every time step of the simulation corresponds to one second in reality. SUMO is a modular model that can be configured in different ways including several objects and tools to adapt it to the necessities of use. Every vehicle that moves within the simulated network is modelled individually and has, on each time step, a certain trip and speed. These values are updated depending on the vehicle ahead and the road network. When simulating traffic, the street restrictions, such as maximum velocity and right of way rules, are regarded [6]. The creation of vehicles and the trips they had to follow in the simulation can be defined in several ways, starting from different input data. For example, vehicles can be generated with a random trip or, if an origin-destination matrix is available, their trip can be extracted from them. The output of the simulation can be "a set of snapshots" of the traffic situation during the simulated period on the city road network. An in-depth analysis of this output can provide significant insights to understand the traffic of the city, for example: what are the most congested roads, what is the peak hour on these roads etc.
In [3,9] the open source traffic model SUMO (simulation of Urban Mobility) has been used to simulate traffic in urban scenarios in association with data obtained from traffic sensors. We considered this model an easy solution to be adapted to the available data and the requirements of the TRAFAIR project. Moreover, it is a flexible and easy-to-set-up model that can be used, in the future, in different cities to obtain and analyze traffic-related data.
To set up the model, calibrators (SUMO objects) were used to redirect vehicle routes and virtual induction loop detectors (SUMO objects) were adopted to compare the real measurements with values obtained in the simulation. The duration of the simulation is a configurable parameter. The time interval to simulate must be greater than fifteen minutes. Daily simulations were executed on High Performances Computers. Every simulation produces an output containing time series of the flow values at each virtual induction loop detectors and each road or lane in the map.
An overview of the realized model is depicted in Figure 1. As we can see, SUMO has been effectively integrated into the TRAFAIR project to create traffic flows for the city of Modena [10]: the input lies on a database and the model outputs are automatically generated and inserted in the same database (TRAFAIR DB).

Input
In the city of Modena, the SUMO model has been configured starting from three main inputs (see the up-part of Figure 1: • the road network of the city, • traffic data collected from sensors (i.e. traffic cameras, induction loop detectors...) • the exact location (latitude and longitude coordinates) of the sensors on the road network.
In a real-time traffic model, the road network should be as similar to reality as possible. We chose Open Street Map (OSM) as the source of geographical data since it was quite detailed for the area of Modena and its format can easily be converted in a SUMO map format. At first, an analysis of the streets of Modena was done to understand the completeness of OSM data in the area of interest. The most important information for our use is composed by the number of lanes, the street name, the maximum speed allowed and the authorized roadway directions. We discovered that only the 36.28% of OSM streets have information about lane number. Since the number of lanes was critical information, data were manually integrated by looking at pictures showing the traffic light junction and sensors. This data has been elaborated to produce the required input for SUMO (an exhaustive description of the SUMO directed graph can be found in [8]). OSM road network can be directly converted to SUMO required format using Netconvert, a specialized tool included in SUMO. The GPS coordinates, the name of the street and the correct lane where the sensors (called detectors in SUMO) were located, have been defined. This information related to sensors were necessary to finally locate detectors in the simulation.
Calibrators are trigger-type objects included in SUMO [8] that can be declared in the SUMO input and act by removing vehicles in excess and by inserting new vehicles to match real traffic observations. A calibrator must be inserted in the SUMO map in the corresponding location of the real induction loop detector. The function of a calibrator is to adapt dynamically traffic flows and vehicles speeds. Therefore, they are usually placed in the SUMO map in the corresponding location of the real induction loop detectors to allow modifying a simulation scenario based on induction loop detectors measurements. Calibrators can also modify the speed of vehicles if the speed on their lane is different from the measured speed they had to reach. Vehicles flow definitions, i.e. the value of vehicle counts and speed that a calibrator aspires to reach in a defined time interval, are used to control the number of vehicles going through a calibrator. Flow definitions are obtained from detectors measurements querying the TRAFAIR DB with an automatic procedure aggregating vehicles count and speed every fifteen minutes.
Calibrators are designed to control the flow through a lane or a road segment. They are dynamic elements: they can change vehicle routes and create or delete vehicles. Their ability to modify dynamically the routes of vehicles in the simulation makes calibrators the best solution for our use case.
In the scope of our model evaluation, SUMO virtual detectors are included in the simulation. These virtual detectors act like real induction loop sensors. They must be placed on the corresponding lane and in the exact position in which real sensors are placed.

Output
The model output provides a representation of the simulated traffic in the urban area of Modena. The generated output includes information about vehicle count, lane density and average speed for every road in the map and every minute of simulation. Moreover, for every position in which virtual induction loop detectors have been located, a value of vehicle count and average speed is given. These data are the one that can be used in the evaluation of the model by comparing them with the real detectors measurements. Outputs have two main dimensions: • The spatial dimension: where the vehicles are located in every time step of the simulation; • The temporal dimension: the evolution of traffic data during the day. To explore the spatial dimension several maps of the city road network are generated from the output of the model (see for example Figure 3). Every map refers to a timestep and displays streets with distinct colors depending on the number of vehicles circulating. The temporal dimension is represented by time series of vehicles counts as in Figure 2. This curve is obtained averaging all the vehicle counts collected by the virtual detectors inserted in the simulation. It shows the daily trend of Monday 19th November. A further analysis is shown in Figure 4, all the roads that were populated by a significant number of vehicles (at least 1000 veh/day) are highlighted in purple. As a consequence of the lack of data, in areas that do not have sensors around several roads have a low number of vehicles. In [2] traffic analysis are performed to compare working days, weekends and to identify significant deviations.

SIMULATION STATISTICS
Several simulations have been performed on the Finis Terrae II supercomputer, an HPC platform managed by CESGA 6 , the Supercomputing Centre of Galicia. Finis Terrae II 7 is a Linux based heterogeneous cluster, with an Infiniband FDR low latency network interconnecting 317 computing nodes based on Intel Xeon Haswell processors. For all the simulations performed, the number of vehicles inserted in the simulation was registered. The number of vehicles does not represent the number of physical vehicles in the city (the vehicle fleet), but the number of routes and trips travelled. A vehicle is deleted from the simulation every time the destination is reached.
Through a comparison of flows in different days of the week, Monday, Wednesday and Friday are the days with the highest number of routes. As expected Sunday has a lower number of vehicles (see Figure 5). UPS stands for Updates Per Seconds, interpreted as the average number of vehicles simulated per second of computation time. When the UPS value is high, there are a lot of vehicles circulating for all the simulated interval. Considering all the simulation performed using HPC resources on November 2018, the obtained Real-time factor (the ratio between the simulated time interval in seconds and the duration of the simulation in seconds) was between 1,03 and 1,76. The execution time of a 19 hours simulation was between 10,9 hours and 18,5 hours with an average of 14 hours.

CONCLUSION AND FUTURE WORK
This paper has reported the implementation of a traffic model based on real traffic sensor data for the city of Modena. Starting from traffic punctual information on 400 locations, the model can provide an overview of traffic intensity on more than 800 km of roads. The realized traffic model will help to understand traffic in the city and to evaluate changes to improve urban mobility. The simulations are realized by using only open source resources (the SUMO model and the road network from Open Street Map), therefore the model can be easily implemented in other cities.
As pointed out in the previous section the simulations have a small real-time factor. We are actually studying how to improve performances of our simulations reducing their execution time. A possible solution has been analyzed in [10] by splitting a daily simulation into sub-tasks, i.e. simulations of smaller intervals, and running these sub-tasks in parallel.
Another parameter that sensibly changed the performance obtained is the time interval to aggregate vehicle counts before passing them to the calibrators. This parameter has to be around ten or fifteen minutes to generate a reliable simulation. In our use case, induction loop detectors are located near traffic lights and the number of vehicles counted when the traffic light is red could not be higher than 1. While, when the traffic light turns green, vehicles have a limited time to pass through the intersection and not all vehicles waiting at the stop can go beyond the crossroad, the others will remain in the queue waiting for the next green light.
Several SUMO simulations are being performed to produce a historical resource of data that will be used in future to make further traffic analyzes and maybe, traffic predictions.

ACKNOWLEDGMENTS
This research has been supported by the TRAFAIR project 2017-EU-IA-0167), co-financed by the Connecting Europe Facility of the European Union. The contents of this publication are the sole responsibility of its authors and do not necessarily reflect the opinion of the European Union.