How gvahck/evacuation works
This repository is a mobile-first, multi-hazard evacuation platform: users configure an evacuation, receive hazard-aware route recommendations, track live progress and reroutes, and review results. The React Native client communicates with a FastAPI backend, which coordinates authentication, session execution, routing, hazards, traffic, persistence, and live telemetry. Its spatial and decision layer combines road-graph routing with a MARL model and traffic simulation; separate research and scenario capabilities support model inspection and experimentation. Relationships are limited to README statements and SOURCE INDEX references or excerpts; unsampled internals are represented cautiously.
Main entry points: client.ts API client · evacuation_service.py Session orchestration · hazard_manager.py Hazard coordination · evacuation_env.py Evacuation environment
Components 25
Mobile app
- Mobile experience
mobile/src/screens/HomeScreen.tsx - Route preview
mobile/src/screens/EvacuationPreviewScreen.tsx - Map renderer
mobile/src/components/MapRenderer.tsx - API client
mobile/src/api/client.ts - Mobile session store
mobile/src/store/evacuationStore.ts
API and sessions
- Authentication API
backend/app/api/routes/auth.py - Evacuation API
backend/app/api/routes/evacuation.py - Session orchestration
backend/app/services/evacuation_service.py - Route API
backend/app/api/routes/routes.py - Session history
backend/app/api/routes/history.py - Hazard API
backend/app/api/routes/hazards.py
Routing and hazards
- Road graph
backend/app/routing/graph_manager.py - Route construction
backend/app/routing/route_builder.py - MARL inference
backend/app/ml/model_manager.py - Hazard coordination
backend/app/hazards/hazard_manager.py - Flood and fire spread
src/hazard
Research and simulation
- Traffic simulation
backend/app/simulation/sumo_manager.py - Research endpoints
backend/app/api/routes/research.py - Scenario endpoints
backend/app/api/routes/scenarios.py - Evacuation environment
src/environment/evacuation_env.py - Learning agents
src/agents/marl_six/offline_online_agent.py
Persistence and telemetry
- Relational storage
backend/app/database/session.py - Evacuation records
backend/app/models/evacuation_session.py - Live telemetry
backend/app/websocket/manager.py
Other components
- Evacuation user
Connections 34
- Evacuation user → Mobile experience: configures evacuation
- Mobile experience → Route preview: previews routes
- Route preview → Map renderer: renders map
mobile/src/screens/EvacuationPreviewScreen.tsx - Mobile experience → API client: requests services
- API client → Evacuation API: sends HTTP
- API client → Authentication API: authenticates
- API client → Session history: loads history
- API client → Research endpoints: requests research
- API client → Scenario endpoints: requests scenarios
- Authentication API → Relational storage: uses database
backend/app/api/routes/auth.py - Authentication API → Evacuation API: authorizes requests
- Evacuation API → Session orchestration: delegates sessions
backend/app/api/routes/evacuation.py - Session orchestration → MARL inference: runs inference
- Session orchestration → Hazard coordination: reads hazards
- Session orchestration → Traffic simulation: advances traffic
- Session orchestration → Relational storage: persists sessions
- Session orchestration → Live telemetry: broadcasts telemetry
- Route API → Route construction: builds routes
backend/app/api/routes/routes.py - Route API → Road graph: queries graph
backend/app/api/routes/routes.py - Route API → Hazard coordination: checks hazards
backend/app/api/routes/routes.py - Hazard API → Hazard coordination: configures hazards
backend/app/api/routes/hazards.py - Hazard coordination → Road graph: uses road graph
backend/app/hazards/hazard_manager.py - Hazard coordination → Flood and fire spread: coordinates engines
backend/app/hazards/hazard_manager.py - Flood and fire spread → Road graph: updates edge states
- Session history → Relational storage: queries sessions
backend/app/api/routes/history.py - Session history → Evacuation records: reads records
backend/app/api/routes/history.py - Live telemetry → API client: streams events
- API client → Mobile session store: updates client state
- Research endpoints → MARL inference: exposes model data
- Scenario endpoints → Evacuation environment: provides scenarios
- Evacuation environment → Learning agents: supports agent learning
- Evacuation environment → Flood and fire spread: simulates hazards
src/environment/evacuation_env.py - Evacuation environment → Traffic simulation: synchronizes traffic
- MARL inference → Learning agents: loads MARL model
backend/app/ml/model_manager.py