Write a program which simulates a forest fire on a 12 x 12


Program: Write a program which simulates a forest fire on a 12 x 12 matrix. You will model the effects of the fire from it's inception until it burns out. Each cell in the grid is in one of three possible states:

Part 1: Forest (notburning)

(^)

Part 2: Burning Forest (*)

Part 3: Empty (previously burnt or cleared) (.)

Each turn, you will apply the following rules to the fire:

? If the cell is currently Empty, it will stay Empty

? If the cell is currently Burning, it will be set to Empty in the next time step

? If the cell is currently a Forest, and none of the cells neighbors are burning, the cell will stay as a Forest

? If a cell is currently a Forest, and one or more neighboring cells are burning, then the cell will be set to Burning in the next time step with probability p. The probability of burning is a parameter that can be set by the user.

You need to make well-formed and clean code. You should not copy and paste the code from other source.

You will prompt the user to enter the number of locations originally burning and the computer will randomly assign the spots. Apply the rules above each turn until the fire burns out or consumes the forest. When the simulation is complete, you will have the computer display the percentage area burned and the number of steps required to do it.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program which simulates a forest fire on a 12 x 12
Reference No:- TGS0954896

Expected delivery within 24 Hours