[] [] [] []
Next: The dynamic model Up: Sample Applications: a CA-based Previous: The Cell   Contents

Cell Surface

At the next highest level in the hierarchy is the cell surface, or the ``world'' that the cells inhabit. As was mentioned in section 2.2, the cell can be thought of as the actual surface of the ground, or as a two-dimensional list of cell-agents. The cell surface is responsible for knowing the geographic locations of every cell, as well as the topological relationships between them. In a cellular lattice, this means that for any cell, the cell surface can identify the neighbor who is at the north, northeast, south, etc. of the cell. This function is a direct extension of the role of linked lists for keeping track of agents in multi-agent simulations- knowing the location, and being able to traverse the list or retrieve the $i^{th}$ member of the list is a fundamental tool for managing multiple agents.

Another important function of lists is managing execution of functions of the agents in a way that ensures an acceptable model of concurrency. In this simulation, when a cell burns, it sends messages to neighboring cells. Since its neighboring cells are likely to be burning as well, any cell will also need to be able to recieve and process messages from several neighbors as it sending its own messages out.

  
Figure 4: The burn cycle of the cell object
\begin{figure}
\centering\epsfig {file=burncycle.eps, width=.6\linewidth}\end{figure}

This was addressed in this simulation by splitting up the burn actions and the sending and processing of messages. When a cell is getting ready to ``do its thing'' (burn a bit), it needs to be sure that it has processed all the inputs that it is to recieve from its neigbhors. When it burns, it needs to make sure that its messages have been delivered to the relevant neighbors. To accomodate this, each cell is provided with a ``message cache'' (think of it as a mailbox). When the cell burns, it sends messages to some of its neighbors. Simultaneously, it will be recieving messages from its neighbors. Before its next time step, the cell will need to evaluate these messages and convert them to inputs for its own burn model.

By segregating the burn function of the cell into a doActions and a processMessages method3, the cellsurface can give a reasonable approximation of concurrency. In the doActions phase, the cellsurface first traverses the list of all its member cells, asking them to do their burn thing. As each cell burns, it sends messages to neighbors, which get stored in the message cache of each cell for future reference. During the processMessages phase, each cell is traversed again and the message caches are evaluated. Each cell evaluates its messages and decides on its inputs for its fire model(s) at the next burn step. Cells that have ``decided'' to ignite at this time step merely flag themselves as ignited, and wait for the next doActions phase to actually start burning. Only after this second traversal is complete, and every cell has processed its inputs, is the action phase permitted to start again. The cycle is illustrated in figures 4 and 5.

  
Figure 5: The cell surface as the burn cycle progresses. Step 1: cells are burning. Step 2: burning cells send messages to neighbors. Step 3: cells evaluate messages, decide whether to burn. Step 4: some of the cells have accepted the request and are burning.
\begin{figure}
\centering\epsfig {file=step-1.eps, width=.45\linewidth}\epsfig {...
..., width=.45\linewidth}\epsfig {file=step-4.eps, width=.45\linewidth}\end{figure}


[] [] [] []
Next: The dynamic model Up: Sample Applications: a CA-based Previous: The Cell   Contents

2000-09-28