Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment will incorporate multidimensional arrays that capture spatial information and location-dependent parametric data. These data are stored in files and used in the simulation

This assignment will incorporate multidimensional arrays that capture spatial information and location-dependent parametric data. These data are stored in files and used in the simulation of events of a real-world scenario. You will write a program to simulate a very simple fire propagation event. For each location of a grid cell, generate a structure to store the various parameters needed for the simulation. Use one grid layer per parameter and one file per layer. Do several runs, and for each timestamp, update the data of all layers, then capture them into respective files.

Scenario: The simulation of fire propagation on the terrain in the wilderness depends on many random events, each of which is influenced by the events which preceded and many factors. This process is similar to the cellular automaton game of life, in which patterns of cells survive or die based on the extent to which their neighboring cells are alive. A run of this process happens at each time unit, and after each run, a new state is generated. Assume a grid of n x n cells is used to cover a space. Onto this grid, define several layers for modeling some of the key ingredients of fire: for instance, a layer for fuel content, a layer of terrain slope, a layer of wind direction, and a layer for fire status. Each layer can be represented in your program as an array, where the data of each array element can be acquired real-time, computed, or generated randomly during the process. To further understand the natural phenomenon that we are modeling, you should consult the reference paper and literature. To derive the proper model used in your system,you should discuss among teammates to define (and write down) the rules for the simulation by making a set of basic assumptions for the occurrence of fire ignition, propagation, and extinction. To illustrate graphically,using the example given in the reference paper,see Figure 4below,a firelit(Fk)is placed at a given grid cell(r,c)(where (1,1) is at top left cell of the grid). The firelet F1locatedat (7, 3) during the first run,Time 1, travels along the NE direction across three cells to cell (5,5), where it finds enough fuel to ignite, burn, and form another firelet F2. At Time 2, the firelet 1 F1at (7, 3) is now blown northbound about 5 cells,and along its path, it found at cell (4,3) enough fuel to burn and establish itself as a firelet F3; while firelet F2travelseastward, and reaching a boundary. At Time 3, both F2and F3travel northward, consuming fuel along the way until they reach the boundary.

image text in transcribed

To elaborate a little further [see ref. p.1359]. Fire ignition consists of the creation of a single firelet. The firelet survives by igniting new fuel and moves in a direction determined by the fire environment. If there is no fuel at the new location, or if the firelet has moved too far from its source, the firelet stops. The next firelet has moved too far from its source, the firelet stops. The next firelet then moves out from the fire center. If this firelet finds a cell that has already been burned, the firelet continues on its journey. Upon finding virgin fuel, the firelet ignites it and stops. When a firelet travels a certain distance determined by the fuel conditions, the firelet goes out. The cellular automaton,in the context of fires, can be thought of as a process by which firelets are sent out one at a time from a fire source. As shown in Figure 5, a fire is ignited at a location (on the Fire Status Layer) given by the user, and any number of fires can be started simultaneously or at set times and places. The eight-cell neighbors of any given pixel are then numbered off in octal(0-7). These neighbors start with weights assigned on the basis of the wind direction and magnitude. These weights are modified by changing the weights to reflect the topography;up-slope aspects are weighted by the magnitude of the slope(Slope Layer). A second modification again changes the weights to reflect the fuel load(Fuel Load Layer), taking into account reduction in fuel as it is consumed by the fire. A random number is then drawn to determine direction of movement. The new firelet location is then burned, and the fire moves on. A run will stop when the gridedge is reached, when no fuel remains, or when a set of distance is reached. Each fire center continues to generate random fire runs of a length which reflects the fuel moisture and pre-heating conditions until its firelets find no unburned fuel. When successive runs find no new fuel to burn, this fire center goes out.

Requirements:1.Generate a set of files, one for each layer to be modeled, and initialized with randomly generated data, suitable to represent the parameters defined by the problem. For instance, the direction of the wind, would be an octal number indicating the direction. 2.Add checks when doing file stream I/Os. If unsuccessful, it should output an error message and prompt the user to enter another file name.3.Define a Structure to gather all the parameters needed to determine the firelet motion. With the file(s)open, read the location data pertaining to each layerinto the named Structure.4.Define a loop to run simulation. Set initial simulation parameters and the total run count. 5.Generate printout function to display visually a snapshot of the status layer.

( PLEASE NEED A SOLUTION ASAP. SHOULD WORK FOR VISUAL STUDIO)

Fuel Lord Aspector Time 1 Time 2 Time 3 gimo bylo W7 WO Second firelet bred First firelet source moves W2 Firelet Source Burning at Time 1 Burning at Time 2 Burning at Time 3 onem Firellot Movement W3 Figure 4. Basic firelet behavior. Figure 5. First motion decisions are made using weights from data layers Fuel Lord Aspector Time 1 Time 2 Time 3 gimo bylo W7 WO Second firelet bred First firelet source moves W2 Firelet Source Burning at Time 1 Burning at Time 2 Burning at Time 3 onem Firellot Movement W3 Figure 4. Basic firelet behavior. Figure 5. First motion decisions are made using weights from data layers

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

=+what kinds of policies and practices should be developed?

Answered: 1 week ago

Question

=+ Of the HR issues mentioned in the case,

Answered: 1 week ago