-
Notifications
You must be signed in to change notification settings - Fork 5
/
single.py
36 lines (28 loc) · 891 Bytes
/
single.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""Run single fire case."""
import numpy as np
from model import wildfire as wf
from model import gen_conditions
outDir = r'./out/'
fieldShape = (100, 50)
lit_1 = gen_conditions.lit_circle(fieldShape, (25, 10), 7, 'infinite')
lit_source_np = np.array([lit_1])
case1 = wf.FireCase(
fieldShape=fieldShape,
neighborhoodSize=5,
ignitionHeat=5,
burnDuration=5,
lit_source_np=lit_source_np,
density_np=gen_conditions.density_bool(fieldShape, 0.5),
moisture_np=gen_conditions.moisture(fieldShape),
terrain_np=gen_conditions.terrain_slope(fieldShape, 0, np.pi/4),
wind_np=gen_conditions.wind_uniform(fieldShape, (10, 5)),
boundaryCondition='infinite',
termConditions=['walls'],
termWalls=['E', 'N'],
outInterval=1)
# Build batch
batch = wf.FireBatch([case1])
batch.initialize_tensors()
# Run model
wf.simulate(batch)
batch.export_params()