ObserverSwarm class documentation

Authors

Generated by pauljohn

Software documentation for the ObserverSwarm class

ObserverSwarm : GUISwarm

Declared in:
ObserverSwarm.h

The ObserverSwarm graphically displays many of these measures as Opinion is running. ObserverSwarm creates a series of rasters, one for each feature in each neighborhood. The "enableToggleRasters" button on the interface will condense this to show a particular feature for each of the neighborhoods, and a left click will toggle between features. Each raster displays the average opinion on that issue of the citizens in each cell of the homeGrid. The average opinion is represented by the color of the cell. By observing the diversity and pattern of colors in the raster, the user can get an idea of the diversity of opinion on the issue at that point in time on that issue. ObserverSwarm also creates graphs that help summarize the model's changes across time. One graph displays the number of interactions and the number of opinion changes that have occurred over time. By observing the number of changes, one can assess the degree of instability that was present at any given point in time. Another graph displays the average opinion on each issue across time. Changes in average opinion indicate instability in opinion on that issue. The third graph displays average acquaintance, harmony, identicality and multidimensional entropy over time. These measures all give the user a picture of the degree of heterogeneity in opinion that exists within the model across time. Using these graphs then, the user can assess stability and heterogeneity of the model at any given time.

Method summary

createBegin:

+ (id) createBegin: (id)aZone;

Initiate the creation of the observer object


activateIn:

- (id) activateIn: (id)swarmContext;

All schedules have to be woven into the larger time reference


buildActions

- (id) buildActions;

Create the actions necessary for the observer part simulation.


buildObjects

- (id) buildObjects;

Create the objects used in the display of the model.


createEnd

- (id) createEnd;

createEnd completes the creation work


drawAllRasters

- (id) drawAllRasters;

flushes the values stored in the memory rasters onto the physical screen


drawFeature:PointX:Y:Color:

- (id) drawFeature: (int)f PointX: (int)posX Y: (int)posY Color: (int)type;

Description forthcoming.


drop

- (void) drop;

Free memory used by allocated objects


enableToggleRasters

- (BOOL) enableToggleRasters;

This switches the GUI dispay. Use it before the model starts. IF NO, then there is one raster per feature/issue per home neighborhood. If YES, then only one feature/issue is shown for each neighborhood.


getRasterArray

- (id<Array>) getRasterArray;

On raster f, at coordinates posX,posY, draw the indicated color. - drawFeature: (int) f PointX: (int) posX Y: (int) posY Color: (int) type {id drawingRaster= [[nhoodRasterArray atOffset: 0] atOffset: f]; [drawingRaster drawPointX: posX Y: posY Color: type]; return self;} /** Return the 2D array of rasters


getRasterArray:

- (id) getRasterArray: (int)nhood;

Return the row of rasters that corresponds to the indicated neighborhood


getValueContactSeq:

- (double) getValueContactSeq: (int)i;

Returns the value of the i'th contact sequence


setParameters:

- (id) setParameters: (Parameters*)params;

Sets the parameter object from which system variables can be retrieved


stopRunning

- (id) stopRunning;

Check to see if the experiment is finished. If so, set the Swarm state to stopped


toggle

- (int) toggle;

Does work needed when toggle rasters is used