Skip to main content

The pure python version of the TraCI API to communicate with the traffic simulation Eclipse SUMO

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traci-1.26.0.tar.gz (103.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

traci-1.26.0-py2.py3-none-any.whl (138.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file traci-1.26.0.tar.gz.

File metadata

  • Download URL: traci-1.26.0.tar.gz
  • Upload date:
  • Size: 103.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for traci-1.26.0.tar.gz
Algorithm Hash digest
SHA256 5084ba6d0cdba78f93863d782d89ed02d278e6566cfc684c3bedccd6f29aa8ed
MD5 62e700aa34798168768a38afa1d4f35a
BLAKE2b-256 eb965489adb00448f640195aeed9fb9bff38f1fd64ef17e1d021449694cc475d

See more details on using hashes here.

File details

Details for the file traci-1.26.0-py2.py3-none-any.whl.

File metadata

  • Download URL: traci-1.26.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 138.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for traci-1.26.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 15dcd143e58a1b03a24687b6871f398d5ff36611fd8aa6b4f3d4ab45603742c0
MD5 aaec974196568af78d64bdb8ff774728
BLAKE2b-256 99e187ffbb1ad9b1cdd1e3c08633e2b94aa920ca0550f17be8c762ed3a0817d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page