- Inherits From:
- Declared In:
World * outputWorld;
Specialist * outputSpecialist;
id archiver, dataArchiver;
FILE * dataOutputFile;
id <EZGraph> hdfWriter;
id <HDF5> hdf5container;
dataFileExists Indicator that dataFile initialization has alreadyoccurred outputWorld Reference to the world, where we can get data! outputSpecialist Reference to the Specialist object, where we can get data! dataArchiver hdf5 or LISP objects, depending on the CPP flags runTime Return from the systems time() function timeString a verbose description of current time dataOutputFile FILE handle for output from C style fprintf hdfWriter EZGraph object that is used only to create hdf5 formatted output hdf5container HDF5 data container object used by hdfWriter currentTime current time of simulation
- - setSpecialist:
- - setWorld:
- - writeParams:BFAgent:Time:
- - prepareOutputFile
- - initializeHDFWriter
- - writeData
- - drop
It is necessary to drop the data writing objects in order to make sure they finish their work.
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.
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:(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:(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
The write data method dumps out measures of the price, dividend, and volume indicators into several formats
- 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