Skip to main content

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.27.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traci 1.27.1
File Size Uploaded
traci-1.27.1.tar.gz 103.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for traci 1.27.1
File Interpreter ABI Platform
traci-1.27.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 242.3 kB

Release files / traci-1.27.1.tar.gz

Download URL traci-1.27.1.tar.gz
Size 103.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9f5ccc66e02db316c078a3b010fea1c40510f0cb8434a2155bfe6248e9058787
BLAKE2b-256 checksum
How to use checksums
24633b0b1405396f12d977fbe50fe77196a6f8896143ecd75f85283bfdac42af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / traci-1.27.1-py2.py3-none-any.whl

Download URL traci-1.27.1-py2.py3-none-any.whl
Size 138.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b4f4fb1cd145461c318aa62df16cfd48494a46631a8c3b62348b901def670c9e
BLAKE2b-256 checksum
How to use checksums
612659f5b3ebdf57efbc45a89d47e95fdbe0d7349cb52e13be1d37722e97413e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.27.1 This release

2 release files

1.27.0

2 release files

1.26.0

2 release files

1.25.0

1 release file

1.24.0

1 release file

1.23.1

1 release file

1.23.0

1 release file

1.18.0

2 release files

1.17.0

1 release file

1.16.0

1 release file

1.15.0

1 release file

1.14.1

1 release file

1.14.0

1 release file

1.13.0

1 release file

1.12.0

1 release file

1.11.0

1 release file

1.10.0

1 release file

1.9.2

1 release file

1.9.1

1 release file

1.9.0

1 release file

1.8.0

1 release file

1.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page