uchicago.src.sim.analysis
Interface DataSourceRecorder

All Superinterfaces:
Recorder, SimEventListener
All Known Implementing Classes:
AbstractDataSourceRecorder, DataRecorder, DistributedDataRecorder, LocalDataRecorder

public interface DataSourceRecorder
extends Recorder

Created by IntelliJ IDEA. User: thowe Date: Jan 2, 2003 Time: 1:18:49 PM To change this template use Options | File Templates.


Method Summary
 void addNumericDataSource(java.lang.String name, NumericDataSource s)
          Adds a NumericDataSource to this DataRecorder with the specified name.
 void addNumericDataSource(java.lang.String name, NumericDataSource s, int maxIntegerDigits, int maxFractionDigits)
          Adds a NumericDataSource to this DataRecorder with the specified name, and specified number of integral and fractional digits.
 void addObjectDataSource(java.lang.String name, DataSource s)
          Adds a DataSource to this DataRecorder with the specified name.
 void createAverageDataSource(java.lang.String name, java.util.ArrayList feedFrom, java.lang.String methodName)
          Creates an average data source from a specified list using a method with the specified name.
 void createAverageDataSource(java.lang.String name, java.util.ArrayList feedFrom, java.lang.String methodName, int maxIntegerDigits, int maxFractionDigits)
          Creates an average data source from a specified list using a method with the specified name.
 void createNumericDataSource(java.lang.String name, java.lang.Object feedFrom, java.lang.String methodName)
          Creates a NumericDataSource using the specified object and the specified method name.
 void createNumericDataSource(java.lang.String name, java.lang.Object feedFrom, java.lang.String methodName, int maxIntegerDigits, int maxFractionDigits)
          Creates a NumericDataSource using the specified object and the specified method name.
 void createObjectDataSource(java.lang.String name, java.lang.Object feedFrom, java.lang.String methodName)
          Creates a DataSource using the specified object and the specified method name.
 void setDelimeter(java.lang.String delimeter)
          Sets the column delimiter.
 
Methods inherited from interface uchicago.src.sim.analysis.Recorder
record, simEventPerformed, write, writeEnd, writeToFile
 

Method Detail

addNumericDataSource

void addNumericDataSource(java.lang.String name,
                          NumericDataSource s,
                          int maxIntegerDigits,
                          int maxFractionDigits)
Adds a NumericDataSource to this DataRecorder with the specified name, and specified number of integral and fractional digits. The NumericDataSource generates the data to be recorded.

Specify a maxIntegerDigits of less than 0 to avoid rounding and truncating the integeral portion of the number. Similarly, specify a maxFractionDigits of less than 0 to avoid rounding and truncating the fractional portion of the number.

Note that the number is rounded if necessary when trucated. For example, with a maxFactionDigits of 2, the number 99.555 becomes 99.56.

Parameters:
name - the name of the data (e.g. Number of Agents)
s - the source of the data
maxIntegerDigits - the maximum number of digits before the decimal point. A value of -1 will record all the digits.
maxFractionDigits - the maximum number of digits after the decimal point. A value of -1 will record all the digits.

addNumericDataSource

void addNumericDataSource(java.lang.String name,
                          NumericDataSource s)
Adds a NumericDataSource to this DataRecorder with the specified name. The NumericDataSource generates the data to be recorded.

Parameters:
name - the name of the data (e.g. Number of Agents)
s - the source of the data

createObjectDataSource

void createObjectDataSource(java.lang.String name,
                            java.lang.Object feedFrom,
                            java.lang.String methodName)
Creates a DataSource using the specified object and the specified method name. Whenever DataRecorder.record is called, the method of this name is called on this object and the result is recorded.

Note the specified method must return an Object, that is, anything but void or a primitive. The method must be public.

Parameters:
name - the name for this data source. This corresponds to the column name when this object is written out to the file
feedFrom - the object on which to call the method
methodName - the name of the method to call

createNumericDataSource

void createNumericDataSource(java.lang.String name,
                             java.lang.Object feedFrom,
                             java.lang.String methodName,
                             int maxIntegerDigits,
                             int maxFractionDigits)
Creates a NumericDataSource using the specified object and the specified method name. Whenever DataRecorder.record is called, the method of this name is called on this object and the result is recorded.

Note the specified method must explicity return a double, that is, the return value of the method signature must be a double (e.g. public double ...). The method must be public.

Parameters:
name - the name for this data source. This corresponds to the column name when this object is written out to the file
feedFrom - the object on which to call the method
methodName - the name of the method to call
maxIntegerDigits - the maximum number of digits before the decimal point. A value of -1 will record all the digits.
maxFractionDigits - the maximum number of digits after the decimal point. A value of -1 will record all the digits.

createNumericDataSource

void createNumericDataSource(java.lang.String name,
                             java.lang.Object feedFrom,
                             java.lang.String methodName)
Creates a NumericDataSource using the specified object and the specified method name. Whenever DataRecorder.record is called, the method of this name is called on this object and the result is recorded.

Note the specified method must explicity return a double, that is, the return value of the method signature must be a double (e.g. public double ...). The method must be public.

Parameters:
name - the name for this data source. This corresponds to the column name when this object is written out to the file
feedFrom - the object on which to call the method
methodName - the name of the method to call

addObjectDataSource

void addObjectDataSource(java.lang.String name,
                         DataSource s)
Adds a DataSource to this DataRecorder with the specified name. The DataSource generates the data that is to be recorded.

Parameters:
name - the name of the data to be recorded
s - the DataSource for the data to be recorded

createAverageDataSource

void createAverageDataSource(java.lang.String name,
                             java.util.ArrayList feedFrom,
                             java.lang.String methodName)
Creates an average data source from a specified list using a method with the specified name. Whenever DataRecorder.record is called, this method is called on all the objects in the list, the resulting values are averaged, and this average is recorded.

Parameters:
name - the name for this data source. This corresponds to the column name when this object is written out to the file
feedFrom - the list of object on which to call the method
methodName - the name of the method to call. This method should return some sub class of java.lang.Number

createAverageDataSource

void createAverageDataSource(java.lang.String name,
                             java.util.ArrayList feedFrom,
                             java.lang.String methodName,
                             int maxIntegerDigits,
                             int maxFractionDigits)
Creates an average data source from a specified list using a method with the specified name. Whenever DataRecorder.record is called, this method is called on all the objects in the list, the resulting values are averaged, and this average is recorded.

Parameters:
name - the name for this data source. This corresponds to the column name when this object is written out to the file
feedFrom - the list of object on which to call the method
methodName - the name of the method to call. This method should return some sub class of java.lang.Number

setDelimeter

void setDelimeter(java.lang.String delimeter)
Sets the column delimiter. Data is written out in tabular format where the columns are separated by the specified delimiter.

Parameters:
delimeter - the new delimiter