Python gRPC client for microscopic traffic simulation
Project description
Python client for micro_traffic_sim gRPC Server
Python client library for the microscopic traffic simulation gRPC server with full type hints support.
Installation
pip install micro-traffic-sim
Usage
import grpc
from micro_traffic_sim import (
ServiceStub,
SessionReq,
Cell,
Point,
ZoneType,
)
# Connect to server
channel = grpc.insecure_channel("127.0.0.1:50051")
client = ServiceStub(channel)
# Create a new session
response = client.NewSession(SessionReq(srid=0))
session_id = response.id.value
# Push grid cells, trips, traffic lights, and run simulation...
Documentation
- Full example: See examples/ for a complete simulation workflow
Running the example
- Start the gRPC server:
cargo run --features server --bin micro_traffic_sim
- Run the example (from repository root):
source clients/python/.venv/bin/activate
python clients/python/examples/main.py
- Generate visualization:
python clients/python/examples/main.py > clients/python/examples/output.txt
gnuplot clients/python/examples/plot_anim.gnuplot
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
micro_traffic_sim-0.1.8.tar.gz
(13.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file micro_traffic_sim-0.1.8.tar.gz.
File metadata
- Download URL: micro_traffic_sim-0.1.8.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
768c749f59e83e9606978dc6f8b91c92687ed006fcc959813ef3b731a35ddd60
|
|
| MD5 |
6357c1d522fe63e0b7f44a253006f580
|
|
| BLAKE2b-256 |
3f6c188a1110f1e6ce7b97c0f64cabd2545ebc77bf0429bb8dcc55408c0cfac1
|
File details
Details for the file micro_traffic_sim-0.1.8-py3-none-any.whl.
File metadata
- Download URL: micro_traffic_sim-0.1.8-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7a648f76eac166616d622c3318b9c28b593e1016393560797c6993898e7c52e
|
|
| MD5 |
a3209b0a1a7863d3f8c09ec783985d37
|
|
| BLAKE2b-256 |
4d0081c901983bc33680e1a3d0069119771a47c9cfaa5a7fc67905f6a037a4b9
|