OpenEnv-compliant reinforcement learning environment for intelligent urban traffic signal optimisation.
A production-grade digital twin of a 4-way intersection and a 3Γ3 multi-agent grid, with a live 3D dashboard, trained DQN agent, LSTM inflow prediction, emergency vehicle preemption, and LLM meta-control.
Team: Neural Ninjas π₯· Β· Meta OpenEnv Hackathon Finals
Quick Start
# Docker (recommended)
docker build -t intelliflow .
docker run -p 7860:7860 intelliflow
# Open http://localhost:7860# Local dev
pip install -r requirements.txt
uvicorn app.api.main:app --port 7860 --reload
What's Inside
IntelliFlow is a complete RL training and evaluation platform for urban traffic signal control. It models:
Live DQN with replay buffer, target network, weight persistence to disk + HF Hub, curriculum difficulty escalation
Tasks
Single-Node Tasks
Task ID
Name
Difficulty
Horizon
Baseline Score
task_suburban_steady
Suburban Steady Flow
Easy
600
~0.55
task_urban_stochastic
Urban Stochastic Rush
Medium
1200
~0.42
task_rush_hour_crisis
Rush Hour Crisis
Hard
1800
~0.30
MARL Grid Tasks (3Γ3, 9 agents, 73-dim obs)
Task ID
Name
Difficulty
Horizon
Baseline Score
task_grid_steady
Grid: Suburban Steady
Medium
600
~0.50
task_grid_rush
Grid: Urban Stochastic
Hard
1200
~0.36
task_grid_crisis
Grid: Rush Hour Crisis
Hard
1800
~0.24
API Reference
Core OpenEnv
POST /reset # Create new episode session
POST /step # Apply action, advance simulation (single-node)
POST /marl_step # Apply per-node actions (MARL sessions)
GET /state # Full environment state + render_hints
GET /tasks # List all 6 tasks
GET /tasks/{id} # Specific task specification
POST /grader # Score episode (0.0β1.0) with sub-scores + impact
POST /baseline # Run baseline policy evaluation
GET /analytics # Rich episode analytics
POST /benchmark # Multi-seed reproducibility benchmark
MARL / A/B
POST /ab_reset # Paired MARL vs fixed-cycle sessions
POST /ab_step # Step both simultaneously, return deltas
POST /escalate_difficulty # Increase arrival pressure (curriculum)
Features
POST /weather # Toggle weather mid-episode (CLEAR/RAIN/HEAVY_RAIN/FOG)
POST /incident # Inject lane incident (BLOCKAGE/BREAKDOWN/DEMAND_SPIKE)
POST /emergency # Dispatch emergency vehicle with BFS routing
POST /commander # Natural language traffic command (LLM-powered)
POST /narrate # Generate impact narrative (COβ, fuel, economic value)
Evaluation
GET /proof_of_learning # DQN vs pressure comparison for judges
GET /training_progress # Rolling reward curve across all episodes
Visualisation
GET /viz # Live 2D dashboard
GET /viz3d # Three.js 3D WebGL ground view
GET /viz/snapshot # Lightweight data snapshot for external renderers
GET /docs # OpenAPI docs (Swagger UI)
# Run full proof-of-learning demo
python demo.py --host http://localhost:7860 --task all
# Or call the endpoint directly (judge-friendly)
curl http://localhost:7860/proof_of_learning
Seven independent process-supervision verifiers are applied at episode end via /grader:
throughput nonzero, delay below random, fairness acceptable, spillback controlled, no sustained gridlock, episode completion, above random floor.
Expected Scores (seed 42)
Task
Random
Fixed-Cycle
Pressure
Trained DQN
Suburban Steady
~0.25
~0.48
~0.55
~0.68
Urban Stochastic
~0.18
~0.36
~0.42
~0.58
Rush Hour Crisis
~0.11
~0.24
~0.30
~0.45
Grid Steady
~0.22
~0.42
~0.50
~0.63
Grid Rush
~0.16
~0.30
~0.36
~0.50
Grid Crisis
~0.10
~0.20
~0.24
~0.38
References
Webster, F.V. (1958). Traffic signal settings. Road Research Technical Paper No. 39.
Varaiya, P. (2013). Max pressure control of a network of signalized intersections. Transportation Research Part C.
Lowrie, P.R. (1990). SCATS β Sydney Coordinated Adaptive Traffic System.
Hochreiter, S. & Schmidhuber, J. (1997). Long Short-Term Memory. Neural Computation.
Sutton, R.S. & Barto, A.G. (2018). Reinforcement Learning: An Introduction. 2nd ed. MIT Press.
IntelliFlow v1.2.0 Β· Neural Ninjas Β· Meta OpenEnv Hackathon 2026