Flood-ABM: An agent-based model of differential flood effects on population groups and their decision-making processes
This repository contains an Agent-Based Model (ABM) that simulates the effects of flooding on population groups, their decision-making processes, and community-level responses. Using Mesa for agent-based modeling and Mesa-Geo for GIS integration, the model captures interactions between individuals, households, businesses, shelters, healthcare systems, and government entities under pre-flood, flood, and post-flood conditions. The ABM evaluates vulnerability, resilience, and decisions made during disasters based on socio-economic factors, demographics, and spatial characteristics.
-
agents/
flood_agents.py
– Defines core agents like Person, Business, House, Shelter, Healthcare, and Government agents.person_agent_assign.py
– Assigns demographics, wealth, education, and mobility attributes to person agents.decision_making_module.py
– Implements decision-making logic for agents (e.g., evacuation, adaptation measures).
-
model/
flood_model.py
– Core model logic that initializes the environment, agents, and simulation steps.
-
space/
flood_space.py
– Handles the GIS environment and spatial interactions using Mesa-Geo.
-
run/
flood_serverrun.py
– Runs an interactive server-based visualization of the simulation.flood_batchrun.py
– Runs batch simulations to collect and analyze large-scale results.scenario_test_batchrun.py
– Tests specific flood scenarios and outputs results.
-
calgary_map_data/
- Contains spatial data such as building layouts and flood maps used for GIS integration.
-
data_collection/
data_collect.py
– Handles data collection during model runs.- Includes scripts for graph generation and post-simulation analysis.
-
data_for_paper/
- Contains simulation results and generated graphs used for research papers.
-
Clone the Repository
Open a terminal and run the following command:git clone https://github.com/your-username/repo-name.git cd repo-name
-
Install Dependencies
Install the required libraries using therequirements.txt
file:pip install -r requirements.txt
-
Run the Interactive Server
To launch the interactive server-based visualization:cd run python flood_serverrun.py
- Open the browser and go to
http://localhost:8521
to view the simulation.
- Open the browser and go to
-
Run Batch Simulations
To execute multiple simulations and save results:python flood_batchrun.py
-
Test Specific Scenarios
For scenario-based batch runs, use:python scenario_test_batchrun.py
Ensure Python 3.8+ is installed on your machine. Use the following command to install the required libraries:
pip install -r requirements.txt
- Mesa 2.1.2
- Mesa-Geo 0.7.1
- Pandas
- NumPy
- Shapely
- Matplotlib
- Seaborn
- Psutil
- Mesa: Mesa Documentation
- Mesa-Geo: Mesa-Geo Documentation
- Literature: (Pending Acceptance) – Title: "Flood-ABM: An agent-based model of differential flood effects on population groups and their decision-making processes" (to be updated upon publication).
Contributions are welcome! Please submit a pull request or open an issue for feedback.
This project is licensed under the MIT License. See the license
file for details.