Chapter 11. Checking on a Swarm's progress: The Observer

Table of Contents
11.1. Monitoring a Swarm
11.2. Making a clickable ZoomRaster
11.3. Displaying Results in Graphs

11.1. Monitoring a Swarm

When a Swarm program is running in the GUI mode, what the user sees is controlled by the top level Swarm that we often call the observer swarm. The observer swarm adopts the GUISwarm protocol, which means that it has all of the features of a Swarm plus some "optional added extras." The file that contains the source that controls the user interface for a specific project may be called simply ObserverSwarm.m. In many examples, authors have customized the name of the file to include the name of their project, as in HeatbugObserverSwarm.m or ForestModelSwarm.m

The most prominent of the extra features of the observer swarm is the control panel. The control panel is the familiar set of buttons that can Start and Stop a swarm model. The control panel also can "step" the simulation through its paces one time-unit at-at-time using the Next button. The Save button on the control panel is intended to save the window positions of objects that are able to do so.

Apart from the control panel, what the user sees at run-time is completely dependent on the particular example that is being considered. It is probably safe to say, however, that if one stays within the Swarm library, without adding external support from the Graph library or other toolkits, then there two especially important kinds of display objects that can be created in ObserverSwarm.m. These two are:

The following sections discuss the achitecture of these two classes of displays in greater depth. Most of the examples for discussion are taken from the Arborgames code provided by Melissa Savage.