TraCI - Traffic Control Interface
TraCI (short for Traffic Control Interface) is an API that provides access to a SUMO traffic simulation, enabling controlling the behavior of multiple simulation objects during a live simulation. It allows for external scripts to interact with the simulation and its vehicles, pedestrians, and infrastructure.
Installation
To use TraCI, you must first have an Eclipse SUMO installation. Install TraCI by simply executing:
pip install traci
A daily version is also available in TestPyPI:
pip install -i https://test.pypi.org/simple/ traci
Getting Started
To use TraCI in your Python code, import the traci module. The following code snippet shows a basic example
of how to connect to a running SUMO simulation using TraCI:
import traci
# Connect to SUMO simulation
traci.start(["sumo", "-c", "path/to/your/sumocfg/file.sumocfg"])
# Simulation loop
step = 0
while step < 1000:
traci.simulationStep()
# Your simulation logic here
step += 1
# Close TraCI connection
traci.close()
Once connected to the SUMO simulation, TraCI provides a range of functions that can be used to query and modify the state of the simulation. For example, you can use TraCI to control the behavior of individual vehicles, modify the traffic light phases, or query the current state of the simulation.
Documentation
The TraCI documentation is available online at http://sumo.dlr.de/docs/TraCI.html. The documentation provides detailed information on the TraCI API, including a list of available functions and their parameters.
Examples
There are some TraCI Tutorials available.
Contributing
If you find a bug in TraCI or have a suggestion for a new feature, please report it on the SUMO issue tracker at https://github.com/eclipse-sumo/sumo/issues. If you would like to contribute code to TraCI, please submit a pull request to the SUMO repository at https://github.com/eclipse-sumo/sumo.
License
TraCI is released under the Eclipse Public License 2.0 (EPL-2.0).
Metadata
Release files for traci 1.28.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| traci-1.28.0.tar.gz | 103.8 kB | Without provenance | Details for traci-1.28.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| traci-1.28.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for traci-1.28.0-py2.py3-none-any.whl |
Total release size: 243.3 kB
Release files / traci-1.28.0.tar.gz
| Download URL | traci-1.28.0.tar.gz |
|---|---|
| Size | 103.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f53483a7f3a15910b88579cfb4c72a8e304364e58a2b3f0a1acbcf460598c6b3
|
|
BLAKE2b-256 checksum How to use checksums |
04f743e04a40da868af0fdc767d417ea27b89958d3b2ec0ae2de0860519e10f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / traci-1.28.0-py2.py3-none-any.whl
| Download URL | traci-1.28.0-py2.py3-none-any.whl |
|---|---|
| Size | 139.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
cbc88b5b38b60c0dba4939f9171615a97bd12dd113c5bc7730d76dfe2db73881
|
|
BLAKE2b-256 checksum How to use checksums |
9aa1a95328ff82da409b46d5ed2723b70dff6a5445776ad95c34b5d1a84de7f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for traci 1.28.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.