The SUMO is used to simulate the traditional traffic lights, adaptive traffic lights, and the proposed V2I strategy. You can reproduce these results on your computer .
You need dependencies below.
The system we use is Ubuntu. If you use Ubuntu, you can install it directly as follows. If not, check out the SUMO. SUMO is already in Ubuntu's official repo and can be installed directly using the following command:
1. sudo apt-get install sumo sumo-tools sumo-doc |
If you need a up-to-date ubuntu version, you can add:
1. sudo add-apt-repository ppa:sumo/stable |
2. sudo apt-get update |
3. sudo apt-get install sumo sumo-tools sumo-doc |
We can use SUMO to simulate many actual traffic scenarios. SUMO is not a single program, but contains multiple packages/applications. It mainly includes the following applications:
You can go to SUMO-Application to learn the details.
Within each policy folder, there are the corresponding network information file.
If you want to learn the meaning of each file, or if you're interested in editing the network yourself, you can check out the SUMO tutorial.
Once SUMO and python3 are installed, you can run the program. For examples, enter the folder 'traditional_traffic' and use python3 to run the main program.
1. cd traditional_traffic |
2. python3 runner.py |
This program will run the results in Simulation1; If you want to get the results in Simulation2, then you need to run the corresponding program in the folder ‘uneven’; If you want to get the result in Simulation3, then you need to modify the parameter ‘ADD_PLATOON_STEP’ in the main program to 300, 900 or 1200.
Vehicles are generated every 6 seconds with probability of 0.3 at the starting point of each lane.
We set the number of vehicles coming from the north-south road much greater than that from the east-west road. In the simulation, a vehicle is generated for every 6 seconds with probability of 0.3 in the north-south direction, while with probability of 0.03 in east-west direction.
In this part, we examine the influence of traffic density on the three IM strategies. The time intervals for generating a vehicle are chosen as 3 seconds, 6 seconds, 9 seconds, and 12 seconds, all with probability of 0.3.
When you start to run SUMO, right-click on the SUMO interface and select ‘show parameter’ to view the current vehicle related information parameters.
We have added statements in the main program so that the result can generate an XML file named'xx_output_file.xml' that contains all vehicle information. Analyzing this XML file, you can get the average delay time and its variance.
You can perform data analysis according to the reference program given in this article. Different files only need to replace the file name in the program.
About the specific content of ‘xml.etree.ElementTree’, if you are interested, you can go to the relevant website to learn.