Repository navigation
Infrastructure and Tools
Priyesh Patel edited this page Oct 17, 2026
·
10 revisions
| Area | Tool or technology | Purpose | Why we chose it | Version or link |
|---|---|---|---|---|
| Simulation Engine & Math Logic (Backend) | Python | Core backend language for simulation logic, optimization algorithms, and statistical analysis | Industry standard for mathematical modeling, discrete-event simulation, and transit operations research. | python.org (v3.12+) |
Python heapq (standard library) |
Event queue and simulation clock for the discrete-event engine | A small queue owned by the team gives a fixed, documented tie order and byte-identical replays, which are the core of US-1.1. SimPy was considered; its process-based model would need extra wrapping to control tie order and the event record format. | docs.python.org/3/library/heapq (Python 3.12+) | |
| NumPy & SciPy | Scientific computation, probability distributions, and parameter fitting | Essential for sampling right-skewed walking and dwell times (Lognormal/Gamma), Maximum Likelihood Estimation, and isolating random substreams for Common Random Numbers (CRN) variance reduction. | scipy.org / numpy.org | |
| Pandas | Tabular data manipulation, time bucketing, and metric aggregation | Efficiently groups passenger records into time buckets, computes median/95th percentiles, and handles helped-versus-harmed group classifications. | pandas.pydata.org (v2.2+) | |
| Backend API & Data Validation | FastAPI | Backend REST API server | High-performance asynchronous framework in Python; handles scenario configuration, run execution triggers, and simulation result streaming with minimal latency. | fastapi.tiangolo.com (v0.115+) |
| Pydantic | Data validation, parameter clamping, and schema definition | Automatically validates simulation input parameters (e.g., maximum hold caps, headway ranges) and returns structured errors before simulation execution. | docs.pydantic.dev (v2.9+) | |
| Frontend Framework & State | React (with TypeScript) | Frontend web application framework | Component-driven architecture with compile-time type safety; prevents state mismatches across complex passenger records, station models, and playback data. | react.dev (v18+) |
| Zustand | Frontend state management for simulation playback and controls | Provides lightweight, boilerplate-free state management to synchronize the shared simulation clock, scrubbing, rewinding, and variable playback speeds (0.5x, 2x, 10x) across side-by-side views. | zustand-demo.pmnd.rs (v4.5+) | |
| Visualization & Reporting | PixiJS | Hardware-accelerated 2D WebGL rendering engine | Renders and animates thousands of individual passenger sprites and train positions smoothly across station transfer corridors without browser DOM slowdowns. | pixijs.com (v8+) |
| D3.js | Data-driven visualization library | Offers custom SVG/Canvas rendering for dual-series comparison charts, confidence intervals, percentile markers (median and 95th), and sensitivity curves. | d3js.org (v7+) | |
| PapaParse | Client-side CSV generation and parsing | Converts simulation output datasets into formatted CSV downloads in the browser for user data exports without adding server load. | papaparse.com (v5.4+) | |
| html2canvas | Client-side visual chart export | Captures rendered comparison charts and distribution graphs into high-resolution image downloads directly from the user interface. | html2canvas.hertzen.com (v1.4+) | |
| Database & Persistence | PostgreSQL | Primary relational database | Provides reliable ACID storage for user-saved scenarios, parameter presets (peak/off-peak), and historical run manifests (seeds, code version, active operating rules). | postgresql.org (v16+) |
| SQLAlchemy | Object-Relational Mapper (ORM) | Integrates PostgreSQL with FastAPI models cleanly, allowing typed queries and straightforward schema migrations. | sqlalchemy.org (v2.0+) | |
| Testing & Verification | Pytest & Hypothesis | Backend unit and property-based testing framework | Hypothesis enables automated generation of edge-case scenarios to guarantee that safety limits (e.g., minimum headway gap, maximum hold length) are never breached. | pytest.org / hypothesis.readthedocs.io |
| Ruff | Python linting and formatting | One fast tool replaces flake8, isort and black, and enforces the rubric limits on complexity (15) and statements per function (50) in CI. | docs.astral.sh/ruff (v0.17.1) | |
| Playwright | End-to-end (E2E) and blackbox UI testing | Automates browser workflows to verify playback controls, parameter inputs, scenario comparisons, and error state handling. | playwright.dev (v1.47+) | |
| DevOps & CI/CD | Docker & Docker Compose | Containerization and local environment orchestration | Packages the backend engine, API, database, and frontend to guarantee consistent runtime environments and cross-platform seed determinism. | docker.com (v27+) |
| GitHub Actions | Continuous Integration and Continuous Deployment (CI/CD) | Automatically executes the test suite and runs determinism verification on every push, ensuring identical seeds produce identical output hashes. | github.com/features/actions |