Skip to main content

Python gRPC client for microscopic traffic simulation

Project description

Python Client for micro_traffic_sim gRPC Server

Python 3.10+ Typing: Typed

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

  1. Start the gRPC server:
cargo run --features server --bin micro_traffic_sim
  1. Run the example (from repository root):
source clients/python/.venv/bin/activate
python clients/python/examples/main.py
  1. 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.0.1.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

micro_traffic_sim-0.0.1-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file micro_traffic_sim-0.0.1.tar.gz.

File metadata

  • Download URL: micro_traffic_sim-0.0.1.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for micro_traffic_sim-0.0.1.tar.gz
Algorithm Hash digest
SHA256 666568d0a9176fcfe0ad534d7a4dd26b5b403bf234f33d0b27d8c74015d7ba52
MD5 b003d01fad2d4816bc59158ebc3b3440
BLAKE2b-256 8067a47d5b05bd57af0598678fdfffcf789646a4dd3f176f0e649e6271e18b6a

See more details on using hashes here.

File details

Details for the file micro_traffic_sim-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for micro_traffic_sim-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 717f23699d7c56234e14fb627071dbcb7f65fdba9c53d36826464aafc866601a
MD5 b467a77850bec6ed7e91015899f7eb02
BLAKE2b-256 376ce447467ed7d3d3b78f575b74c19f031a95ef4edd051aa88a82129c54cf1c

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