BatchSwarm class documentation

Authors

Generated by pauljohn

Software documentation for the BatchSwarm class

BatchSwarm : Swarm

Declared in:
BatchSwarm.h

If you want to run a model over and over again, you should do it without a graphical interface because it will be faster and simpler to do it that way. BatchSwarm is a "replacement" for ObserverSwarm in batch runs. The command line switch - b turns on batch mode, and it sets the Swarm global variable SwarmGUIMode=NO, and, if you look in main, you will see that makes BatchSwarm the "top level" Swarm.

In case you want to run in batch mode, you are urged to run the model from the command line with the --help and --usage options in order to see all the values that can be set from the command line. Study MyArguments to see how those command line values are parsed. Then use some program like Drone (http://drone.sourceforge.net), or the simpler perl script "replicator" (http://lark.cc.ku.edu/~pauljohn/Swarm/MySwarmCode).


Instance Variables

Method summary

createBegin: 

+ (id) createBegin: (id)aZone;

Begin the creation of BatchSwarm


activateIn: 

- (id) activateIn: (id)swarmContext;

Place the schedules created in buildActions onto the larger time frame of the model


buildActions 

- (id) buildActions;

Create schedules to make the model go


buildObjects 

- (id) buildObjects;

Creates the objects needed for a batch simulation. That includes the HDF graph data output files, the model swarm itself, and then a bunch of record keeping objects and variables.


checkToStop 

- (id) checkToStop;

Decide if the model should quit


drawFeature: PointX: Y: Color: 

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

uses special batch raster methods to draw a color on the graph at position posX,posY for feature/issue "f".


drop 

- (void) drop;

When the simulation ends, Batch Swarm is told to drop, and when that happens, we need to make sure that the data-keeping objects save their results and close up. So this method passes on the drop message to the hdf5 dataset as well as the model swarm, which in turn has a drop method that closes up datasets.


getRasterArray: 

- (id) getRasterArray: (int)nhood;

Returns nil because there is no raster array, as there is in observer swarm.


getValueContactSeq: 

- (double) getValueContactSeq: (int)i;

Returns the value of the i'th contact sequence. They are


go 

- (id) go;

go is a customized method that performs the simple job of telling the swarm activity structure to begin processing actions that were scheduled. It is basically the same as hitting start in the Graphical Model.


setParameters: 

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

Puts in the paramter object, so the BatchSwarm can tell what parameter values are being used.


stopRunning 

- (id) stopRunning;

Dump a snapshot of the rasters and quit


writeRasters 

- (id) writeRasters;

Save the batch raster snapshot into a file.




Instance Variables for BatchSwarm Class

batchColormap

@protected BatchColormap* batchColormap;

Description forthcoming.


contactSeq

@protected id contactSeq;

Description forthcoming.


currentNhood

@protected int currentNhood;

Description forthcoming.


deadSteps

@protected int deadSteps;

Description forthcoming.


displayActions

@protected id displayActions;

Description forthcoming.


displaySchedule

@protected id displaySchedule;

Description forthcoming.


end

@protected int end;

Description forthcoming.


experimentDuration

@protected unsigned int experimentDuration;

Description forthcoming.


featureDisplay

@protected id featureDisplay;

Description forthcoming.


hdfGraph

@protected id hdfGraph;

Description forthcoming.


loggingFrequency

@protected int loggingFrequency;

Description forthcoming.


modelSwarm

@protected ModelSwarm* modelSwarm;

Description forthcoming.


nhoodFeatureList

@protected id nhoodFeatureList;

Description forthcoming.


nhoodRasterArray

@protected id nhoodRasterArray;

Description forthcoming.


parameters

@protected Parameters* parameters;

Description forthcoming.


stopSchedule

@protected id stopSchedule;

Description forthcoming.


worldRaster

@protected BatchRaster* worldRaster;

Description forthcoming.


worldSize

@protected int worldSize;

Description forthcoming.