Introduction#
Tools can be found in the SUMO-distribution under <SUMO_HOME>/tools. Most of them are tiny - they were written for a certain purpose and worked well under certain input, but may be not verified for other cases.
All tools should work with Python 3.7 or later on Windows, Linux and macOS.
We try to keep them compatible with Python 3.5 and 2.7 as well. Some of them
depend on external libraries, which can be installed using
pip install -r tools/requirements.txt
. For details on installation
and required versions see also the Linux installation instructions.
How to use python tools#
Python tools are usually called from the command line. In the documentation linked below, the tools are described with a command like
python tools/xml/xml2csv.py input.xml
This works only, if the current working directory is <SUMO_HOME>.
For the Windows OS, to run the tool from any directory, you can use
python %SUMO_HOME%\tools\xml\xml2csv.py input.xml
The equivalent command for Linux is
$SUMO_HOME/tools/xml/xml2csv.py input.xml
If you have $SUMO_HOME/tools/xml on your PATH (see ConfigurePathSetting), you can simple type
xml2csv.py input.xml
For scripts in other subdirectories of tools you have to replace xml in this example by the name of the subdirectory
Using tools from netedit#
Since version 1.17.0, netedit supports calling many tools via configuration dialog by using the 'Tools' menu. For a demonstration, see the SUMO 2023 Conference tutorial.
Tools by category#
The tools are divided into the following topics:
- assign - traffic assignment tools
- build_config - tools used for code styling and by the building subsystems
- detector - some tools for dealing with real life induction loop data
- devel - tools for developers
- district - tools for handling traffic analysis zones (TAZ) aka districts
- drt - tools to simulate demand responsive transport
- emissions - tools for computing and visualizing emissions
- import - additional tools to import data from a variety of formats
- net - tools for working with networks (mainly SUMO-networks)
- output - python tools for working with sumo output files
- railways - tools for the simulations of trains
- route - tools for working with routes
- shapes - tools for working with shapes (PoIs and polygons)
- sumolib - python library for working with sumo networks, simulation output and miscellaneous utility functions
- tls - tools for traffic light systems
- traceExporter - generate mobility traces / trajectories / orbits / gps tracks in various formats
- traci - Python implementation of the TraCI interface
- trip - Trip generation and modification without od2trips
- turn-data - some tools with turning counts and turning ratio data with real life induction loop data
- visualization - graphical evaluation of SUMO-outputs
- xml - python tools for converting xml and xml schema related utilities
- miscellaneous - tools that do not fit the above categories
Caution
Please always ensure that you have the environment variable SUMO_HOME properly set.