Inferno Version 0.0.1 Documentation - Lucaman99/Forest_Fire_Engine GitHub Wiki
This is the preliminary draft of the documentation for the first version of Inferno, the dynamic software package for the cellular-automata simulation of land wildfires.
Documentation
inferno.CreateRandomGrid(width, length, tree_density, starting_coordinate_width, starting_coordinate_length)
Creates a forest fire grid on which a fixed number of trees are placed completely randomly. The width
and length
selectors allow for input of the width and length of the rectangular grid, measured in number of grid squares. The tree_density
keyword is a number corresponding to the number of trees that should be placed randomly on the grid. The starting_coordinate_width
and the starting_coordinate_length
selector are used to specify the bottom-left coordinate of the grid (see inferno.CompositeGrid
function).
This function returns a list of elements in the form: [[x-coordinate, y-coordinate], tree]
. The x-coordinate
and y-coordinate
values represent the coordinates of a tree, the tree
value takes on the value of either 0 or 1, representing whether the grid square contains a tree or not.
inferno.CreateFixedGrid(width, length, coordinate_file, starting_coordinate_width, starting_coordinate_length)
Creates a forest fire grid on which trees are placed based on data from a file inputted by the user. The coordinate file a plain text file of 2-dimension lists of the form: [x-coordinate, y-coordinate]
, separated by commas, representing placements of trees. The other input variables and the output is the same as inferno.CreateRandomGrid
.
inferno.CreateClusterGrid(width, length, meanclustersize, frac_allowed, tree_density, starting_coordinate_length, starting_coordinate_width)
Creates a forest grid in which a given fraction of trees are allocated to "clusters", and the remaining trees of placed randomly. For a mathematically rigorous definition, see the following paper. The meanclustersize
keyword specifies roughly how large the clusters of trees placed on the cluster grid should be (measured in the number of trees in a cluster). The frac_allowed
keyword represents the fraction of trees (from the total number of trees) which will be allocated to the creation of cluster. This value is inputted as a real number between 0 and 1. The remaining keywords and output are the same as the previous functions.
inferno.CreateEvenGrid(width, length, prob_iter, tree_density, starting_coordinate_length, starting_coordinate_width)
This function create an "even grid", where the user is able to specify roughly how far they want the trees to be spaced apart. The prob_iter
keyword is a value corresponding to the probability at each iteration outward from a given tree placement, that the next tree will be placed at the next-closest square (this explanation does not do the underlying mathematical concept on which this function is based justice. A research paper explaining the algorithm and the mathematical process involved in creating this method will be released soon). The remaining keywords and output are the same as the previous functions.
inferno.CompositeGrid(grid_1, grid_2, ..., grid_n)
This function joins together multiple grids. It takes any number of grids as arguments, and returns a larger grid with all of their respective coordinates joined together into one larger grid, if they are compatible (for example, if they don't overlap). The output is the same as previous functions.
inferno.spread_random_fire(grid_found)
This function simulates a fire upon a given grid by initializing a fire at a randomly chosen, tree-containing grid square. The output of this function is in the form [[x-coordinate, y-coordinate], tree, burn, iteration]
. The "burn" value also takes on a value of either 0 or 1, and signifies whether a grid square has burned (if the grid square contains a tree, meaning "tree = 1"). The iterations
value represents the time step on which a grid square was burned (if it contains a tree, and had been burned during the simulation, otherwise this value remains at 0).
inferno.spread_fixed_fire(grid_found, start)
This function also simulates a fire upon a grid, but instead of random initialization, the user can input a coordinate in the place of the start
keyword, specifying where the fire should begin. The output is the same as the inferno.spread_random_fire
function.