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.1.9.tar.gz (13.1 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.1.9-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: micro_traffic_sim-0.1.9.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

Hashes for micro_traffic_sim-0.1.9.tar.gz
Algorithm Hash digest
SHA256 1d47cc3df0127cf940ce2de26e016f0073e4f9e9a3486cc5d69dcc54ca6b6079
MD5 c77905d8a59dbd3971a08a5b5834775c
BLAKE2b-256 b751ec2c16c21db963147eceed6e58f64270c888cbe86c01f6256196e0385c60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for micro_traffic_sim-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 96ab563638ccb4f383c5643a57a582d0145e11edc9010283879f154b4ccc997f
MD5 80408fb8affe70acf5b60b60bed7bbd7
BLAKE2b-256 82e6b44b563e1a0196452ff27a3c3f458e6225b58bf035d4d825a2a599577311

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