embrs.fire_simulator.cell#
Representation of the discrete cells that make up the fire sim.
- class embrs.fire_simulator.cell.Cell(id: int, col: int, row: int, cell_size: float, z=0.0, fuel_type=<embrs.fire_simulator.fuel.Fuel object>)#
Class representation of the discrete cells that make up the fire sim. This holds the state of each cell as well as the relevant fire spread parameters. Cells are regular hexagons in the “point-up” orientation.
- Parameters:
id (int) – unique id of the cell within the sim
col (int) – column index of the cell within the
cell_grid
row (int) – row index of the cell within the
cell_grid
cell_size (float) – size of the cell, edge length of the hexagons, units: meters
z (float, optional) – elevation of the cell measured in meters, defaults to 0.0
fuel_type (
Fuel
, optional) – type of fuel present at the cell, can be any of the 13 Anderson FBFMs, defaults to Fuel(1)
- property burnable_neighbors: set#
Set of cells adjacent to the cell which are in a burnable state.
Each element is in the form (id, (dx, dy))
“id” is the id of the neighboring cell
“(dx, dy)” is the difference between the column and row respectively of the cell and its neighbor
- calc_cell_area()#
Calculate the area of a cell in meters squared
- Returns:
area of a cell given in meters squared
- Return type:
float
- property cell_area: float#
Area of the cell, measured in meters squared.
- property cell_size: float#
Size of the cell in meters.
Measured as the side length of the hexagon.
- property col: int#
Column index of the cell within the
cell_grid
- property dead_m: float#
Dead fuel moisture of the cell, as a fraction (0 to 1)
- property fire_type: FireTypes#
Current type of fire burning at the cell.
Either
FireTypes.PRESCRIBED
orFireTypes.WILD
, -1 if not currently in stateCellStates.FIRE
.
- property fuel_content: float#
Fraction of fuel remaining at the cell, between 0 and 1
- property neighbors: list#
List of cells that are adjacent to the cell.
Each list element is in the form (id, (dx, dy))
“id” is the id of the neighboring cell
“(dx, dy)” is the difference between the column and row respectively of the cell and its neighbor
- property row: int#
Row index of the cell within the
cell_grid
- property state: CellStates#
Current state of the cell.
Can be
CellStates.FUEL
,CellStates.BURNT
, orCellStates.FIRE
.
- property t_d: float#
Estimate of the time (in seconds) it will take the current fire to propagate across the cell.
-1 if the cell is not on fire
- to_log_format()#
Returns a dictionary of cell data at the current instant. Contains all data necessary to capture changes to the state of a cell over time. Used to create logs of the sim for visualization or post-processing use.
- Returns:
Dictionary with the following fields:
”id”: (int) representing the id of the cell object
”state”: (
CellStates
) representing the current state of the cell”fuel_content”: (float) representing the amount of fuel remaining in the cell
If the cell’s state is on fire the dictionary will also include:
”fire_type”: (
FireTypes
) representing type of fire in the cell
- Return type:
dict
- to_polygon()#
Generate a Shapely polygon representation of the hexagonal cell.
- Returns:
A Shapely polygon representing the hexagonal cell
- Return type:
shapely.geometry.Polygon
- property x_pos: float#
x position of the cell within the sim, measured in meters.
x values increase left to right in the sim visualization window
- property y_pos: float#
y position of the cell within the sim, measured in meters.
y values increase bottom to top in the sim visualization window
- property z: float#
Elevation of the cell measured in meters
Classes
|
Class representation of the discrete cells that make up the fire sim. |