Python gRPC client for macroscopic traffic simulation via 4-step demand model
Project description
Python client for macro_traffic_sim gRPC Server
Python client library for the macroscopic traffic simulation gRPC server with full type hints support.
Installation
pip install macro-traffic-sim
Usage
import grpc
from macro_traffic_sim import (
MacroServiceStub,
NewSessionRequest,
Node,
Link,
Zone,
NetworkChunk,
ZoneChunk,
ModelConfigRequest,
BprConfig,
RunPipelineRequest,
LinkVolumesRequest,
UUIDv4,
)
# Connect to server
channel = grpc.insecure_channel("127.0.0.1:50052")
client = MacroServiceStub(channel)
# Create a new session
response = client.NewSession(NewSessionRequest())
session_id = response.session_id.value
print(f"Session: {session_id}")
# Push network, zones, configure, run pipeline, get results...
Documentation
- Full example: See examples/ for a complete simulation workflow
Running the example
- Start the gRPC server:
cargo run --features server --bin macro_traffic_sim
- Run the example (from repository root):
source clients/python/.venv/bin/activate
python clients/python/examples/main.py
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
macro_traffic_sim-0.2.1.tar.gz
(15.5 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 macro_traffic_sim-0.2.1.tar.gz.
File metadata
- Download URL: macro_traffic_sim-0.2.1.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cd3655318788e433c98e812ec204f0adfd0f6f0f714fb940c151e23d7b80343
|
|
| MD5 |
995c3a6ed4a74e67a1d7ba43ab947d00
|
|
| BLAKE2b-256 |
86ecb73c245adff809efffc6fc41c98be48a4a359e86aac411784bb014e716c9
|
File details
Details for the file macro_traffic_sim-0.2.1-py3-none-any.whl.
File metadata
- Download URL: macro_traffic_sim-0.2.1-py3-none-any.whl
- Upload date:
- Size: 26.2 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 |
073de68b96bd02e27813e1b6b5012822fd1e2bfc417d6d20d0033634f3a20cef
|
|
| MD5 |
f9157d7b6a2f8377d720bd36067b8f54
|
|
| BLAKE2b-256 |
f6bfcc839bae47031f862479e2a98c44cc88d6f3db1c44362ccd8b9c5887b1f4
|