Parallel Computing
Links
Forest Fire
Code
TO DO
-
Grid size NxN
-
Probability P
-
Initialize grid
-
Each slot may or may not contain a tree
-
Use probability P to decide tree or no tree
-
Any slot's decision independent of others
-
Simulation
-
Time zero set trees in the left-hand column on fire
-
At each time step fire spreads: up down left right
-
No wrapping at the boundaries and no diagonals
-
-
Result is the number of steps for the fire to burn out
-
It is possible there are still some trees leftover
-
-
Plot - Turn In
-
Grid size (N), number of trials (T), resolution (DP)
-
For each P from 0 to 1 stepping by DP
-
Run T trials with an NxN grid - be careful srand
-
Calculate average burnout time over all trials
-
-
Two columns: P and AVG
-
Normalize AVG burnout time by dividing it by N
-
Two endpoints: (P,AVG)=(0,0) and (P,AVG)=(1,1)
-
-
Plot using spreadsheet, gnuplot, etc
-
Report N and T and DP
-
Find the max(AVG) and report (P,AVG) for it
-
-
ListNode
-
-
MPI
-
-
Laws
-
Back to Parallel
4 Sept 2015