- 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).
Method summary
Begin the creation of BatchSwarm
Place the schedules created in buildActions onto the larger time frame of the model
Create schedules to make the model go
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.
Decide if the model should quit
uses special batch raster methods to draw a color on the graph at position posX,posY for feature/issue "f".
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.
Returns nil
because there is no raster
array, as there is in observer swarm.
Returns the value of the i'th contact sequence. They are
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.
Puts in the paramter object, so the BatchSwarm can tell what parameter values are being used.
Dump a snapshot of the rasters and quit
Save the batch raster snapshot into a file.