This application plots graphs of CO2 emission and fuel consumption of various vehicles which simulated by SUMO traffic simulator.
We are going to use osmWebWizard tool which comes with the SUMO installation.
You start the OSM Web wizard by invoking the following command in the tools directory of SUMO.
python osmWebWizard.py
At the opened browser page, you can choose any desired area for simulation. (You can also set how many vehicles there will be)
Clicking on "Generate Scenario" will trigger generation, and automatically SUMO-gui will appear. But we will not going to use any kind of gui material. So you can close it afterwards.
The OSM Web Wizard stores the entire simulation scenario sumo config and intermediate files in a local directory with a name in the format of "yyyy-mm-dd-hh-mm-ss". The data will be stored inside the tools directory.
In order to take emission output, you should run following command in the freshly generated "yyyy-mm-dd-hh-mm-ss" directory.
Example: sumo -c "C:\Program Files (x86)\DLR\Sumo\tools\2018-03-13-16-54-59\osm.sumocfg" --emission-output "C:\Users\<your-username>\Desktop\output.xml"
Note: You should create the output.xml
file before running this command.
See this page for various outputs.
Python scripts on this repo are brief demonstrations of graph plotting using simulation data.
Simply run python co2_plotter.py
to plot.