🚨 Track

Safety: protecting individuals and communities through emergency response and disaster preparedness.

💡 Inspiration

In an emergency, the layout of a building matters as much as the alarm. Yet many schools, dorms, mosques, and public buildings have exit layouts that have never been tested, because real evacuation drills are rare, disruptive, and can't recreate a spreading fire or rising water. A single crowded door can turn a safe exit into a dangerous bottleneck.

We asked: what if anyone could test a building's evacuation plan on a computer before a real emergency happens? That question became SafeEvac.

🔥 What it does

SafeEvac is a Java simulation of emergency evacuation:

  1. Load a floor plan from a simple text map (walls, rooms, exits, hazard start point).
  2. Choose a hazard (fire or flood) and the number of people.
  3. Watch the simulation: every person (adult, child, or elderly, each with a different speed) finds the nearest safe exit while avoiding the hazard and other people.
  4. Read the results: total evacuation time, a crowd heatmap, the slowest exit, and the number of people who did not escape.
  5. Get a suggested fix, such as adding or widening an exit, then re-run the simulation and compare before vs. after.

🛠️ How we built it

SafeEvac is a pure Java project with no external AI API. The value comes from the model and the algorithms.

  • Language and tools: Java 17, JavaFX, Maven
  • Pathfinding: BFS / A* on a grid to find the shortest safe route to an exit
  • Hazard spread: a Hazard interface with Fire and Flood implementations, each spreading cell by cell every simulation step
  • People: an abstract Person class with Adult, Child, and Elderly subclasses (different speeds)
  • Crowd analysis: a Map<Cell, Integer> counts how many people pass through each cell, which creates the heatmap and reveals bottlenecks
  • Maps: loaded from text files, with custom exceptions for invalid maps or missing exits

Evacuation time is measured as the step at which the last person reaches an exit:

$$T_{evac} = \max_{p \in P} t_p$$

where ( t_p ) is the time at which person ( p ) reaches a safe exit.

Architecture

Main → MapLoader → Simulation (loop) → Person / Hazard / PathFinder → ReportGenerator → JavaFX UI

🧗 Challenges

  • Making people avoid each other and the hazard without getting stuck or walking through walls
  • Keeping the simulation fast enough to animate smoothly with many people
  • Designing a fair rule for suggesting a new exit instead of guessing
  • Building the whole thing within the hackathon time limit

📚 What we learned

  • How to apply OOP principles (abstraction, interfaces, polymorphism) to a real problem
  • How pathfinding and agent-based simulation work in practice
  • That crowd behavior around one narrow door can matter more than the total number of exits
  • How to explain a technical project clearly in a short demo

📊 Results

[Add your own measured result, for example: "On our sample classroom map with X people, evacuation time dropped from A steps to B steps after adding one exit." Use real numbers from your demo, or delete this section.]

🔮 What's next

  • Import real floor plans from images or CAD files
  • Add more hazards (earthquake, smoke)
  • Model people who stop to help others
  • Export a PDF safety report for schools and building managers
  • Let users compare multiple layouts side by side

Built With

  • a-star
  • agent-based-modeling
  • bfs
  • emergency-response
  • java
  • maven
  • oop
  • pathfinding
  • safety
  • simulation
Share this project:

Updates

Submission history