Forest fire model

[1]:
from SOC.models import Forest
/progs/miniconda3/lib/python3.7/site-packages/statsmodels/tools/_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
  import pandas.util.testing as tm
[2]:
T chance_of_thunder = 0.001
model = Forest(p=0.04, f=chance_of_thunder, L=50, save_every = 1)

model.plot_state(False)
[2]:
_images/ForestFire_2_0.png
_images/ForestFire_2_1.png
[3]:
model.run(1000, wait_for_n_iters=1000)
Waiting for wait_for_n_iters=1000 iterations before collecting data. This should let the system thermalize.

  • 0 - ash
  • 1 - tree
  • 2 - burning
[4]:
model.animate_states(notebook=True, interval=100)
[5]:
model.data_df
[5]:
AvalancheSize NumberOfReleases number_of_iterations
0 0 0 75
1 0 0 74
2 0 0 67
3 0 0 74
4 0 0 77
... ... ... ...
995 0 0 68
996 0 0 60
997 0 0 48
998 0 0 47
999 0 0 47

1000 rows × 3 columns

[14]:
model.data_df.number_of_iterations.plot()
[14]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f9ea2102f90>
_images/ForestFire_7_1.png