A Windows console simulation that visualizes how people evacuate a building while fire spreads through the grid. The project compares several pathfinding strategies, adapts algorithm choice to changing danger, and includes a settings system for difficulty, building size, fire spread, obstacle density, and optional output saving.
- Simulates multiple people navigating toward exits on a grid map.
- Spreads fire over time and forces people to recalculate paths as conditions change.
- Uses a mix of BFS, Dijkstra, A*, hybrid adaptive routing, and multi-objective pathfinding.
- Shows live status in the console with step count, rescued count, burned count, and optional heat map/statistics views.
- Can save final artifacts for each run into
output/when enabled. - Lets you choose a difficulty preset that changes building size, fire spread rate, obstacle density, and population size.
From the main menu:
1- Auto mode2- Manual mode3- Fast auto mode4- Open settingsQ- Quit
In settings:
1- Easy preset, small building, lighter fire spread2- Normal preset, medium building, balanced challenge3- Hard preset, large building, heavier fire spread4- Toggle the default output-saving preference5- Return to the main menu
During a simulation:
Q- Quit the current runM- Switch between auto and manual mode+/-- Speed up or slow down the simulationS- Show detailed algorithm statisticsH- Show the heat mapSpace- Advance one step in manual mode
These screenshots are displayed below for quick viewing:
Every completed run writes two files into output/:
output/simulation_report_<timestamp>.txt- Run summary, status breakdown, and person detailsoutput/final_grid_<timestamp>.txt- Final grid snapshot at the end of the simulation
Before each run, the program asks whether you want to save the output for that run. If you choose no, the simulation still runs normally and skips exporting files.
When saving is enabled, the paths are also printed in the console after each run so they are easy to open from VS Code or Windows Explorer.
src/main.cpp- Application entry point and menusrc/SimulationManager.cppandinclude/SimulationManager.h- Simulation loop, display logic, and output exportsrc/Grid.cppandinclude/Grid.h- Map generation, obstacle generation, and renderingsrc/Fire.cppandinclude/Fire.h- Fire spread logic with configurable spread ratesrc/Person.cppandinclude/Person.h- Person behavior and adaptive evacuation logicsrc/PathfindingAlgorithms.cppandinclude/PathfindingAlgorithms.h- BFS, Dijkstra, A*, hybrid, and multi-objective routinginclude/ConsoleUI.h- Console rendering helpers cd S:\FireEvacuation_AnalysisOfAlhm\backend ; node server.js
cd S:\FireEvacuation_AnalysisOfAlhm\frontend ; node node_modules/vite/bin/vite.js --host 127.0.0.1
include/Position.h- Grid coordinate type
- The project is designed for Windows because it uses console-specific APIs.
- The simulator creates the
output/folder automatically if saving is enabled and it does not already exist. - If you want to inspect a run after closing the program, open the files in
output/.
Use this command from the project root:
g++ -std=c++17 -Iinclude src/main.cpp src/SimulationManager.cpp src/Grid.cpp src/Fire.cpp src/Person.cpp src/PathfindingAlgorithms.cpp -o fire_sim.exe
