SETRS is an emergency corridor orchestration prototype for Bengaluru road networks. It combines SUMO + TraCI simulation, a FastAPI backend, a control-room dashboard, and a citizen alert app to demonstrate how ambulance movement, hospital assignment, route control, and signal preemption can be coordinated end to end.
The current repo contains:
- a SUMO-backed emergency traffic control simulation
- a FastAPI backend for routing, corridor logic, and traffic state
- a React/Vite dashboard for operators
- a React Native Expo app for corridor-based citizen alerts
SETRS focuses on one core problem: reducing ambulance delay through proactive traffic signal control and route-aware corridor management.
The system demonstrates:
- precomputed emergency corridor logic
- ordered signal preemption along a known route
- hospital assignment from a simulated hospital pool
- route and corridor visualization in a control-room dashboard
- citizen-side corridor alerting in a mobile app prototype
Instead of reacting only to the nearest junction, SETRS computes the ambulance route in advance, extracts upcoming traffic signals, estimates approach timing, and coordinates the next part of the corridor before the ambulance arrives.
At a high level:
- Select or receive an incident origin
- Assign a hospital from the available pool
- Compute a route and corridor
- Track ambulance progress along that route
- Transition upcoming signals through prepare, preempt, and restore states
- Surface the system state in the dashboard and mobile client
Ambulance departure
|
v
Route extraction + signal sequence build
|
v
Per-step ETA evaluation
|
v
Signal strategy selection
|
v
PREPARE -> ALL_RED -> GREEN -> RESTORE
The implementation separates:
- computation and control logic in the backend
- playback and operator visualization in the dashboard
- citizen impact flow in the mobile alert client
Experiments were run on the Bengaluru SUMO network with fixed configurations and reproducible scenarios.
| Scenario | Vehicles | Baseline | Smart (Adaptive) | Improvement | Stops |
|---|---|---|---|---|---|
| Low | 20 | 1,510 s | 1,134 s | -24.9% | 11 -> 3 |
| Medium | 60 | 1,924 s | 1,435 s | -25.4% | 19 -> 12 |
| High | 120 | 5,928 s | 4,860 s | -18.0% | 61 -> 62 |
Aggressive mode under high load:
| Baseline | Aggressive | Improvement | vs Adaptive |
|---|---|---|---|
| 5,928 s | 4,021 s | -32.2% | +14.2 pp |
| Scenario | Vehicles | Baseline | Smart (Adaptive) | Improvement |
|---|---|---|---|---|
| Low | 20 | 559 s | 559 s | 0.0% |
| Medium | 60 | 686 s | 735 s | -7.1% |
| High | 120 | 1,196 s | 926 s | +22.6% |
Aggressive mode under high load:
| Baseline | Aggressive | Improvement |
|---|---|---|
| 1,196 s | 1,053 s | -12.0% |
The results are intentionally honest:
- gains are strongest under real congestion
- short corridors do not always benefit under low or medium demand
- aggressive mode helps more on longer, heavily congested corridors
This is expected behavior for signal control. The system does not invent gains where queue pressure is low.
The repository includes:
- per-scenario CSV outputs in results
- combined JSON summaries
- chart images for presentation
- a preemption demo GIF
Key files:
- all_results.json
- results_C1.json
- results_C2.json
- chart_improvement.png
- chart_timeline.png
setrs/
backend/ FastAPI APIs, routing, corridor, simulation logic
dashboard/ React + Vite operator dashboard
ambulance-alert-app/ React Native Expo mobile app
sumo/ SUMO configs, routes, cached corridor inputs
results/ Experiment outputs, charts, and demo artifacts
The FastAPI backend provides:
- route generation
- corridor and progress logic
- signal extraction
- simulated traffic state
- hospital assignment
- active emergency feed for the mobile app
Important files:
- main.py
- mapbox_directions.py
- corridor_engine.py
- hospital_catalog.py
- signal_catalog.py
Representative endpoints:
GET /routeGET /route/progressGET /route/trafficGET /active-emergencyWS /ws/live
The simulated hospital pool currently includes 6 hospitals:
- St John's Hospital
- Apollo Spectra Hospital
- Manipal Hospital Koramangala Clinic
- NIMHANS Hospital
- Jayadeva Hospital
- Sagar Hospitals Jayanagar
The dashboard shows 3 at a time:
- 1 assigned hospital
- 2 alternatives
The dashboard is a React + Vite control-room interface for:
- route visualization
- signal state presentation
- ambulance progress
- hospital assignment visibility
- traffic/corridor status
Local development:
cd setrs/dashboard
npm install
npm run devNotes:
- local development uses the Vite
/apiproxy - hosted deployment uses
VITE_API_BASE_URL
See the dashboard-specific documentation:
- dashboard/README.md
The Expo-based mobile app is a thin citizen alert client. It is scoped intentionally to one purpose:
Notify only users physically inside the active ambulance corridor.
It currently includes:
- location fetch
- corridor membership check
- distance-based alert levels
- simple live map
- app-side polling of
/active-emergency
See:
- ambulance-alert-app/README.md
- Python 3.10+
- SUMO 1.18+
- Node.js + npm
Backend dependencies are listed in:
- backend/requirements.txt
cd setrs/backend
python -u run_experiment.pycd setrs/backend
python generate_charts.pycd setrs/dashboard
npm install
npm run devTerminal 1:
cd setrs/backend
python -m uvicorn main:app --host 0.0.0.0 --port 8000Terminal 2:
cd setrs/ambulance-alert-app
set EXPO_PUBLIC_API_BASE_URL=http://YOUR_LAPTOP_IP:8000
npm startUse your real LAN IP, not 127.0.0.1, when testing on a phone via Expo Go.
Recommended hosted setup:
- Backend: Railway
- Dashboard: Netlify
Deploy backend to Railway.
Included deploy files:
- railway.json
- Procfile
- runtime.txt
Required environment variable:
MAPBOX_TOKEN=your_mapbox_token
Deploy dashboard to Netlify.
Included deploy files:
- netlify.toml
- .env.example
Required environment variable:
VITE_API_BASE_URL=https://your-railway-backend.up.railway.app
Behavior:
- without
VITE_API_BASE_URL, the dashboard uses local/apiproxying - with
VITE_API_BASE_URL, it calls the hosted backend directly
This repo is demo-grade and prototype-grade, not production-ready.
Current limitations:
- hospital availability is simulated, not live-integrated
- signal control is simulated, not connected to real ATCS/BATCS infrastructure
- notification delivery is prototype-level, not production push infrastructure
- multi-ambulance arbitration is limited
- some flows are deterministic playback for demo stability
The strongest accurate framing is:
SETRS is a credible emergency corridor orchestration prototype that combines routing, signal preemption, hospital assignment, and citizen alerting in a single demonstrable system.
- live hospital registry integration
- real city signal control deployment
- production-grade push notification infrastructure
This project was developed as a collaborative team effort.
Core contributors:
- Mohammad Siddiq Saiyed -
mohammadsiddiqsaiyed@gmail.com - Syed Nasir -
sd.nasirsyed21@gmail.com - 'https://github.com/NamelessMonster/'
The most natural next upgrades are:
- real hospital data integration
- production push notifications
- multi-ambulance conflict handling
- real traffic-control integration
- more robust hosted deployment and environment separation