traci


Nametraci JSON
Version 1.19.0 PyPI version JSON
download
home_pagehttps://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html
SummaryThe pure python version of the TraCI API to communicate with the traffic simulation Eclipse SUMO
upload_time2023-11-06 22:17:06
maintainer
docs_urlNone
authorDLR and contributors
requires_python
licenseEPL-2.0
keywords traffic simulation traci sumo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://test.pypi.org/project/traci/) 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:

```python
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](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](https://sumo.dlr.de/docs/Tutorials/index.html#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/issues](https://github.com/eclipse/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](https://github.com/eclipse/sumo).

## License

TraCI is released under the Eclipse Public License 2.0 (EPL-2.0).

            

Raw data

            {
    "_id": null,
    "home_page": "https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html",
    "name": "traci",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "traffic simulation traci sumo",
    "author": "DLR and contributors",
    "author_email": "sumo@dlr.de",
    "download_url": "https://files.pythonhosted.org/packages/9f/4f/567c6ea61f0b19e931575c3cc266b119296de0a6f57538e757b7b59b4f83/traci-1.19.0.tar.gz",
    "platform": null,
    "description": "# TraCI - Traffic Control Interface\n\nTraCI (short for Traffic Control Interface) is an API that provides access to a SUMO traffic simulation,\nenabling controlling the behavior of multiple simulation objects during a live simulation.\nIt allows for external scripts to interact with the simulation and its vehicles, pedestrians, and infrastructure.\n\n## Installation\n\nTo use TraCI, you must first have an Eclipse SUMO installation. Install TraCI by simply executing:\n```pip install traci```\n\nA [daily version](https://test.pypi.org/project/traci/) is also available in TestPyPI:\n```pip install -i https://test.pypi.org/simple/ traci```\n\n## Getting Started\n\nTo use TraCI in your Python code, import the `traci` module. The following code snippet shows a basic example\nof how to connect to a running SUMO simulation using TraCI:\n\n```python\nimport traci\n\n# Connect to SUMO simulation\ntraci.start([\"sumo\", \"-c\", \"path/to/your/sumocfg/file.sumocfg\"])\n\n# Simulation loop\nstep = 0\nwhile step < 1000:\n    traci.simulationStep()\n    # Your simulation logic here\n    step += 1\n\n# Close TraCI connection\ntraci.close()\n```\n\nOnce connected to the SUMO simulation, TraCI provides a range of functions that can be used to query and modify\nthe state of the simulation. For example, you can use TraCI to control the behavior of individual vehicles,\nmodify the traffic light phases, or query the current state of the simulation.\n\n## Documentation\n\nThe TraCI documentation is available online at\n[http://sumo.dlr.de/docs/TraCI.html](http://sumo.dlr.de/docs/TraCI.html). The documentation provides detailed\ninformation on the TraCI API, including a list of available functions and their parameters.\n\n## Examples\n\nThere are some [TraCI Tutorials](https://sumo.dlr.de/docs/Tutorials/index.html#traci_tutorials) available.\n\n## Contributing\n\nIf you find a bug in TraCI or have a suggestion for a new feature, please report it on the SUMO issue tracker at\n[https://github.com/eclipse/sumo/issues](https://github.com/eclipse/sumo/issues). If you would like to contribute\ncode to TraCI, please submit a pull request to the SUMO repository at\n[https://github.com/eclipse/sumo](https://github.com/eclipse/sumo).\n\n## License\n\nTraCI is released under the Eclipse Public License 2.0 (EPL-2.0).\n",
    "bugtrack_url": null,
    "license": "EPL-2.0",
    "summary": "The pure python version of the TraCI API to communicate with the traffic simulation Eclipse SUMO",
    "version": "1.19.0",
    "project_urls": {
        "Download": "https://sumo.dlr.de/download",
        "Homepage": "https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html"
    },
    "split_keywords": [
        "traffic",
        "simulation",
        "traci",
        "sumo"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bda1f6cdfd1e87eac7c0aa936edbd40b27e66d583f05c49aff64d7aea8adf9ce",
                "md5": "728e9366c99d9e4be86e97dc8ca8da85",
                "sha256": "42d8c851b8f440dfa5823f51fb35b1dd3a1089ec3204a32002a1a3541deb75cc"
            },
            "downloads": -1,
            "filename": "traci-1.19.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "728e9366c99d9e4be86e97dc8ca8da85",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 124498,
            "upload_time": "2023-11-06T22:17:03",
            "upload_time_iso_8601": "2023-11-06T22:17:03.610931Z",
            "url": "https://files.pythonhosted.org/packages/bd/a1/f6cdfd1e87eac7c0aa936edbd40b27e66d583f05c49aff64d7aea8adf9ce/traci-1.19.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9f4f567c6ea61f0b19e931575c3cc266b119296de0a6f57538e757b7b59b4f83",
                "md5": "9d2b8a3e80d6db75f8463e88f3cefa69",
                "sha256": "917da841437d158c32073d67794f4757f555c72fcb44e78a5dad2429d2b41aae"
            },
            "downloads": -1,
            "filename": "traci-1.19.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9d2b8a3e80d6db75f8463e88f3cefa69",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 92785,
            "upload_time": "2023-11-06T22:17:06",
            "upload_time_iso_8601": "2023-11-06T22:17:06.202946Z",
            "url": "https://files.pythonhosted.org/packages/9f/4f/567c6ea61f0b19e931575c3cc266b119296de0a6f57538e757b7b59b4f83/traci-1.19.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-06 22:17:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "traci"
}
        
Elapsed time: 0.15753s