Commit 4f5ce675 authored by hm-schuegra's avatar hm-schuegra
Browse files


parent e7b29b14
# PythonTraciWrapper
This code is a python wrapper around the Java TraCI-implementation in vadere.
## Work in Progress
If you want to update the python traci wrapper with the current master run the following git command from Vadere's root source code path:
git subtree pull --prefix Tools/PythonTraciWrapper master --squash
## Dependencies
## Run this code
0. Install dependencies
- install python
- install IPython via pip or conda
- install py4j via pip (see
1. cd into python-traci-wrapper
2. In a python environment, run
python install
3. Verify installation
- cd into vadere's root directory
- checkout branch traci_phsc
- mvn clean && mvn package -DskipTests
- Open a python console and run
from pythontraciwrapper.py4j_client import Py4jClient
args = ["--loglevel", "OFF",
"--base-path", "Scenarios/Demos/roVer/scenarios",
"--gui-mode", "True"]
client = Py4jClient("", args)
## Run multiple clients in parallel
To run multiple clients, three port numbers have to be specified for each client without collisions:
- the manager port: where the VadereManager runs
- the java port: the port of the py4j EntryPoint
- the python port: here the python callback server listens
For two clients, this means six different port numbers are required.
from IPython import embed
from pythontraciwrapper.py4j_client import Py4jClient
baseArgs = ["--loglevel", "OFF",
"--base-path", "Scenarios/Demos/roVer/scenarios",
"--gui-mode", "True"]
args1 = baseArgs + ["--port", "9997", "--java-port", "10001", "--python-port", "10002"]
args2 = baseArgs + ["--port", "9998", "--java-port", "10003", "--python-port", "10004"]
cli1 = Py4jClient("", args1)
cli2 = Py4jClient("", args2)
scenarioPath = "scenario002"
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment