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.


Instance Variables

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;

On raster f, at coordinates posX ,posY, draw the indicated color.


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) getRasterArray;

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




Instance Variables for ObserverSwarm Class

colormap

@protected id colormap;

allocate colors


contactGraph

@protected id contactGraph;

Description forthcoming.


contactSeq

@protected id contactSeq;

Description forthcoming.


displayActions

@protected id displayActions;

An ActionGroup of things done at display time


displayFrequency

@protected int displayFrequency;

How many timesteps before display updates (usu dayLength)


displaySchedule

@protected id displaySchedule;

Schedule of display updates


modelSwarm

@protected ModelSwarm* modelSwarm;

the Swarm we're observing


nhoodFeatureList

@protected id nhoodFeatureList;

An Array of Arrays of feature displays. One Array for each N-hood, each of them has a display for each feature


nhoodRasterArray

@protected id nhoodRasterArray;

An Array of Arrays of rasters, one for each N-hood/feature


opinionGraph

@protected id opinionGraph;

graphs opinion levels


parameters

@protected Parameters* parameters;

Description forthcoming.


stopSchedule

@protected id stopSchedule;

checks to see if the simulation should stop


summaryGraph

@protected id summaryGraph;

graphing widgets


toggleRasters

@protected BOOL toggleRasters;

are toggleRasters enabled?


worldRaster

@protected id worldRaster;

2d display widget