An agent-based model for human evacuation from buildings using Reinforcement Learning (RL). Agents make decisions based solely on local observations through RayPerceptionSensor3D components, simulating limited human vision in dynamic environments.
Key Innovation: Agents have no prior knowledge of building layouts and learn to find exits through an adaptive reward system, handling random obstacles and environmental changes in real-time.
Agents use dual-layer RayPerceptionSensor3D (upper/lower) scanning 180° arc parallel to floor:
- Detects: Walls, Agents, Exits, Doors
- Key Feature: Low barriers impede movement but don't block vision (rays pass over them)
Reward Type | Condition |
---|---|
✅ Exit Reward | Reaching exit |
❌ Wall Collision | Colliding with wall |
❌ Agent Collision | Colliding with other agent |
❌ Time Penalty | Exceeding evacuation time |
- Random agent placement at episode start
- Dynamic obstacles (door opening/closing)
- Realistic agent-agent interactions
- No global map knowledge - decisions based solely on sensor data
Component | Purpose |
---|---|
Unity 2023.2.0f1 | 3D environment, physics, rendering |
ML-Agents 1.1.0 | Reinforcement learning framework |
PyTorch 2.2.1 | Neural network backend |
C# | Agent logic, environment interaction |
Python 3.10.12 | Training configuration & execution |
TensorBoard | Training metrics visualization |
Script | Responsibilities |
---|---|
Agent_Logic.cs |
- Action processing (movement, rotations) - Observation collection - Collision handling - Heuristic control |
LevelManager.cs |
- Agent registration - Episode reset logic - Group management - Reward calculation |
AgentSettings.cs |
Centralized parameters (ScriptableObject): - Movement speeds - Penalty values - Ray configurations |
Door.cs |
Door state management and interaction handling |
Essential reading before starting:
Verified Software Versions:
Component | Version | Notes |
---|---|---|
Unity | 2023.2.0f1 | Requires exact version |
ML-Agents | 1.1.0 | Python package |
Python | 3.10.12 | Must be 3.10.1-3.10.12 |
PyTorch (CUDA) | 2.2.1 | GPU acceleration |
Clone repository
git clone https://github.com/LastPeek1/agent-based-evacuation-modeling.git
cd agent-based-evacuation-modeling