Skip to main content

Python gRPC client for macroscopic traffic simulation via 4-step demand model

Project description

Python client for macro_traffic_sim gRPC Server

Python 3.10+ Typing: Typed

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

  1. Start the gRPC server:
cargo run --features server --bin macro_traffic_sim
  1. 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.1.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

macro_traffic_sim-0.1.1-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file macro_traffic_sim-0.1.1.tar.gz.

File metadata

  • Download URL: macro_traffic_sim-0.1.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for macro_traffic_sim-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0ebe38fbbfd0f7bd230473bf350ee80e5b902f3ab5070fc09a6c67f24f47114a
MD5 3a697ed3be3bb8325c97ee9b8fdc3363
BLAKE2b-256 348d85a81507254ce319556656780acb0ea0fbcc2e5f2d1bfdbd5a0a70b284ae

See more details on using hashes here.

File details

Details for the file macro_traffic_sim-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for macro_traffic_sim-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce9eba715480ab18b00c27d3af11e918be84be3e1aa0d56af9525e789199c09e
MD5 91787df648be50f97d40acfceaf1ea27
BLAKE2b-256 123594b089a0638887d45f32391f68b1bf63c4784e92b22b7f5b1772afefd61c

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