Simulating forest fires using 2D cellular automata to understand the dynamics, scaling laws, critical exponents and transitions.
This project is a (partial) implementation of the paper - A cellular automata model for forest fire spread prediction
Please install the following packages before running the code
- Python 3+ (tested with v3.11)
- NumPy, SciPy, Matplotlib, Pandas,
- math, random, time, os, scipy
- openpyxl, powerlaw
Initialize simulation:
rows = 100
cols = 100
n_simulations = 100
sim = WildFireSimulation(rows, cols)
- To see animation for one run
visualizer = Visualize('Fire_data_n100.xlsx')
visualizer.animate(sim, steps=200)
- To see the effect of varying parameters
- create a MakePlots object, run a loop over ranges of parameters and call sensitivity_analysis function
plotter = MakePlots(sim)
parameters = ['percentage_tree_1', 'wind_speed', 'alpha']
values = [[0, 10, 20],
[2, 4, 6],
[0.06, 0.07, 0.08]] # change corresponding param value ranges
for i, parameter in enumerate(parameters):
print(parameter, "-----", values[i])
plotter.sensitivity_analysis(sim, parameter, values[i], n_simulations)
- To see the power-law behaviour
- create a visualize object with the dataset you want to look at
- then call the function scaling behavior
visualizer = Visualize('Fire_data_n100.xlsx') # change file-name here
visualizer.scaling_behavior()
- To see the effect of clustering
- run the clustering_analysis method of the MakePlotter class
- parameters of the sweep are editable inside of make_plots.py
- data analysis is done in clustering_plots.ipynb notebook
plotter = MakePlots(sim)
plotter.clustering_analysis()
- A cellular automata model for forest fire spread prediction
- Forest fire spread using cellular automata
- Parallel CellularAutomaton Wildfire
- Introduction of self-organised critical forest fire model
- Design and implementation of an integrated GIS-based cellular automata model to characterise forest fire behaviour