Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(MATLAB) Write a program that simulates the following model for fire growth. We assume that we have a rectangular grid with a fixed number of

(MATLAB)

image text in transcribed

Write a program that simulates the following model for fire growth. We assume that we have a rectangular grid with a fixed number of rows and columns. Initially, the grid is presumed to have trees that can fuel a fire. We then simulate a fire that starts at a specified cell off the grid. At each step, the fire burns out all of the fuel of its current cell, while moving to an adjacent cell that still has fuel (horizontally or vertically; not diagonally). In particular, if there is a choice of neighboring cells having fuel, it picks one of those choices uniformly at random for the next step. A trial should end when the fire either reaches a cell at the boundary of the grid, or when it reaches a location in which all meighboring squares have already been visited, in which case the fire bums out. Create a file fire.m implementing a function with the following specifications. function outcomes fire (numRows numCols start Row startcol.) simulate the spread of a fire USAGE outcomes fire nunRow numcols, start Row, startcol.) The simulation wi ill be performed on a grid with specified number of rows and columns assumed to be numbered starting at (1,1) at the top-left The fire begins at location t (StartRow startcol) within that grid A series offranues from a trial of fire(7, 7, 4, 4) The next step goes to the left exiting the grid. The final frame of a trial fire(2e, se, 1e, 1s) in which the fire reaches the bottom edge of the region Write a program that simulates the following model for fire growth. We assume that we have a rectangular grid with a fixed number of rows and columns. Initially, the grid is presumed to have trees that can fuel a fire. We then simulate a fire that starts at a specified cell off the grid. At each step, the fire burns out all of the fuel of its current cell, while moving to an adjacent cell that still has fuel (horizontally or vertically; not diagonally). In particular, if there is a choice of neighboring cells having fuel, it picks one of those choices uniformly at random for the next step. A trial should end when the fire either reaches a cell at the boundary of the grid, or when it reaches a location in which all meighboring squares have already been visited, in which case the fire bums out. Create a file fire.m implementing a function with the following specifications. function outcomes fire (numRows numCols start Row startcol.) simulate the spread of a fire USAGE outcomes fire nunRow numcols, start Row, startcol.) The simulation wi ill be performed on a grid with specified number of rows and columns assumed to be numbered starting at (1,1) at the top-left The fire begins at location t (StartRow startcol) within that grid A series offranues from a trial of fire(7, 7, 4, 4) The next step goes to the left exiting the grid. The final frame of a trial fire(2e, se, 1e, 1s) in which the fire reaches the bottom edge of the region

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions