Output


Inherits From:
SwarmObject
Declared In:
Output.h


Class Description

createEnd does a lot of specific things that make the data output objects work. It gets the system time, uses that to fashion a filename that includes the time, then where necessary it creates archivers which will later be called on to get readings on the system and record them.


Instance Variables

BOOL dataFileExists;
World * outputWorld;
Specialist * outputSpecialist;
id archiver, dataArchiver;
time_t runTime;
char timeString[100];
FILE * dataOutputFile;
id <EZGraph> hdfWriter;
id <HDF5> hdf5container;
int currentTime;

dataFileExistsIndicator that dataFile initialization has alreadyoccurred
outputWorldReference to the world, where we can get data!
outputSpecialistReference to the Specialist object, where we can get data!
dataArchiverhdf5 or LISP objects, depending on the CPP flags
runTimeReturn from the systems time() function
timeStringa verbose description of current time
dataOutputFileFILE handle for output from C style fprintf
hdfWriterEZGraph object that is used only to create hdf5 formatted output
hdf5containerHDF5 data container object used by hdfWriter
currentTimecurrent time of simulation


Method Types

- setSpecialist:
- setWorld:
- writeParams:BFAgent:Time:
- prepareOutputFile
- initializeHDFWriter
- writeData
- drop

Instance Methods

drop

- (void)drop

It is necessary to drop the data writing objects in order to make sure they finish their work.


initializeHDFWriter

- (void)initializeHDFWriter

In case the Output class is told to write output data and there is no hdfWriter object yet, then this method will be run. I could not find another way to make sure that this object was not created unless the system actually tries to write data. It cannot be done in the prepareOutputFile method, because that method can be called from the GUI before the Specialist and World objects exist. Those objects are necessary to initialize an hdfWriter, as seen in this code.


prepareOutputFile

- prepareOutputFile

Because it is possible for users to turn on data writing during a run of the simulation, it is necessary to have this method which can initialize the data output files. Each time this is called, it checks to see if the files have already been initialized. That way it does not initialize everything twice.


setSpecialist:

- setSpecialist:(Specialist *)theSpec

The output object needs to have a reference to a Specialist object, from whom it can gather data on the volume of trade.


setWorld:

- setWorld:(World *)theWorld

The output object must have a reference to a World object, from which it can get price, dividend, or any other information it wants


writeData

- writeData

The write data method dumps out measures of the price, dividend, and volume indicators into several formats


writeParams:BFAgent:Time:

- writeParams:modelParam BFAgent:bfParms Time:(long int)t

This flushes a snapshot of the current parameter settings from both the ASMModelParams and BFAgentParams into a file


Version 1.1 Copyright ©2001. All Rights Reserved.