- Inherits From:
- GUISwarm
- Declared In:
- ASMObserverSwarm.h
Note that the ASMObserverSwarm has a set of "standard" methods that Swarms have--buildObjects:, buildActions, activateIn:--and inside each one it makes sure that the next-lower level, the ASMModelSwarm, is sent the same message.
If you don't want to watch the GUI, run the model in batch mode, meaning you use the -b flag on the command line.
int displayFrequency;
id <ActionGroup> displayActions;
id <Schedule> displaySchedule;
Output * output;
ASMModelSwarm *asmModelSwarm;
BOOL writeParams;
BOOL writeData;
id <EZGraph> priceGraph;
id <EZGraph> volumeGraph;
id <Histogram> positionHisto;
id <Histogram> relativeWealthHisto;
id <Graph> deviationGraph;
id <Averager> deviationAverager;
id <GraphElement> deviationData;
id <ActiveGraph> deviationGrapher;
displayFrequency update frequency for graphs displayActions set of actions necessary to keep display up to date displaySchedule Schedule that causes the displayActions to be carried out output An output object asmModelSwarm Instance of ASMModelSwarm, where agents and the world are created and scheduled writeParams Indicator that files including parameter values should be written writeData Indicator that files including output values should be written priceGraph Time plot of risk neutral and observed market price volumeGraph Time plot of market trading volume positionHisto Histogram showing amount of stock held by each individual agent relativeWealthHisto Histogram showing wealth of agents deviationGraph As of ASM-2.0, this was commented out in ASMObserverSwarm.m deviationAverager ditto deviationData ditto deviationGrapher ditto
- + createBegin:
- - printPriceGraph
- - printVolumeGraph
- - printDeviationGraph
- - printRelWealthHisto
- - createEnd
- - _writeRawData_
- - buildObjects
- - priceGraphDeath_:
- - volumeGraphDeath_:
- - updateHistos
- - writeSimulationParams
- - ifParamWrite
- - expostParamWrite
- - toggleDataWrite
- - buildActions
- - activateIn:
- - drop
+ createBegin:aZone
No method description.
- _writeRawData_
If data logging is turned on, this cause data to be written whenever it is called
- activateIn:swarmContext
This method activates the model swarm within the context of this observer, and then it activated the observer's schedules. This makes sure that the actions inserted at time t inside the model are placed into the overall time sequence before the observer scheduled actions that update graphs which describe the results
- buildActions
Create actions and schedules onto which the actions are put. Since this is an observer, the actions are intended to make sure data is collected, displayed to the screen, and written to files where appropriate
- buildObjects
This creates the model swarm, and then creates a number of monitoring objects, such a graphs which show the price trends, volume of stock trade, and some excellent bar charts which show the holdings and wealth of the agents. These bar charts (histograms) are available in very few other Swarm programs and if you want to know how it can be done, feel free to take a look!
- createEnd
No method description.
- (void)drop
In order to make sure that the data is actually written to disk, it is necessary to pass a "drop" message down the hierarchy so that all data writers know it is time to finish up their work. This drop method is called at the end of the main.m file and it propogates down to all objects created in asmModelSwarm
- expostParamWrite
If the writeParams variable is set to YES, then this method cause the system to save a snapshot of the parameters after the system's run ends.
- (BOOL)ifParamWrite
Returns the condition of the writeParams variable, an indicator that parameters should be written to files
- priceGraphDeath_:caller
This method is needed to stop run-time hangs when users close graph windows by clicking on their system's window close button
- printDeviationGraph
This is a legacy method. We need to update Swarm if it is ever to work again
- printPriceGraph
This is a legacy method. We need to update Swarm if it is ever to work again
- printRelWealthHisto
This is a legacy method. We need to update Swarm if it is ever to work again
- printVolumeGraph
This is a legacy method. We need to update Swarm if it is ever to work again
- (BOOL)toggleDataWrite
This toggles data writing features. It can be accessed by punching a button in a probe display that is shown on the screen when the simulation begins
- updateHistos
This method gathers data about the agents, puts it into arrays, and then passes those arrays to the histogram objects. As soon as we tell the histograms to draw themselves, we will see the result
- volumeGraphDeath_:caller
This method is needed to stop run-time hangs when users close graph windows by clicking on their system's window close button
- writeSimulationParams
This causes the system to save a copy of the current parameter settings. It can be turned on by hitting a button in the probe display that shows at the outset of the model run, or any time thereafter.