|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.analysis.DataRecorder
public class DataRecorder
Created by IntelliJ IDEA. User: thowe Date: Jan 2, 2003 Time: 1:06:17 PM To change this template use Options | File Templates.
| Constructor Summary | |
|---|---|
DataRecorder(java.lang.String fileName,
SimModel model)
Constructs a DataRecorder using the specified file name and model. |
|
DataRecorder(java.lang.String fileName,
SimModel model,
boolean batch)
Deprecated. |
|
DataRecorder(java.lang.String fileName,
SimModel model,
boolean isBatch,
java.lang.String headerComment)
Deprecated. |
|
DataRecorder(java.lang.String fileName,
SimModel model,
java.lang.String headerComment)
Constructs a DataRecorder using the specified file name, model, and headerComment. |
|
| 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 |
record()
Records the data for the current tick in tabular format. |
void |
setDelimeter(java.lang.String delimeter)
Sets the column delimiter. |
void |
simEventPerformed(SimEvent evt)
|
void |
write()
Writes the recorded data out to a file in tabular format. |
void |
writeEnd()
Writes any ending matter to the file. |
void |
writeToFile()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataRecorder(java.lang.String fileName,
SimModel model)
fileName - the file to which the data is recordedmodel - the model from which the data is drawn. The relevant
model parameters (set/get parameters, rng seed) are written to the header
of the file.
public DataRecorder(java.lang.String fileName,
SimModel model,
java.lang.String headerComment)
fileName - the file to which the data is recordedmodel - the model from which the data is drawn. The relevant
model parameters (set/get parameters, rng seed) are written to the header
of the fileheaderComment - a comment to prepend to the file header information
public DataRecorder(java.lang.String fileName,
SimModel model,
boolean batch)
fileName - model - batch -
public DataRecorder(java.lang.String fileName,
SimModel model,
boolean isBatch,
java.lang.String headerComment)
fileName - model - isBatch - headerComment - | Method Detail |
|---|
public void addNumericDataSource(java.lang.String name,
NumericDataSource s,
int maxIntegerDigits,
int maxFractionDigits)
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.
addNumericDataSource in interface DataSourceRecordername - the name of the data (e.g. Number of Agents)s - the source of the datamaxIntegerDigits - 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.
public void addNumericDataSource(java.lang.String name,
NumericDataSource s)
addNumericDataSource in interface DataSourceRecordername - the name of the data (e.g. Number of Agents)s - the source of the data
public void createObjectDataSource(java.lang.String name,
java.lang.Object feedFrom,
java.lang.String methodName)
Note the specified method must return an Object, that is, anything but void or a primitive. The method must be public.
createObjectDataSource in interface DataSourceRecordername - the name for this data source. This corresponds to the column
name when this object is written out to the filefeedFrom - the object on which to call the methodmethodName - the name of the method to call
public void createNumericDataSource(java.lang.String name,
java.lang.Object feedFrom,
java.lang.String methodName,
int maxIntegerDigits,
int maxFractionDigits)
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.
createNumericDataSource in interface DataSourceRecordername - the name for this data source. This corresponds to the column
name when this object is written out to the filefeedFrom - the object on which to call the methodmethodName - the name of the method to callmaxIntegerDigits - 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.
public void createNumericDataSource(java.lang.String name,
java.lang.Object feedFrom,
java.lang.String methodName)
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.
createNumericDataSource in interface DataSourceRecordername - the name for this data source. This corresponds to the column
name when this object is written out to the filefeedFrom - the object on which to call the methodmethodName - the name of the method to call
public void addObjectDataSource(java.lang.String name,
DataSource s)
addObjectDataSource in interface DataSourceRecordername - the name of the data to be recordeds - the DataSource for the data to be recorded
public void createAverageDataSource(java.lang.String name,
java.util.ArrayList feedFrom,
java.lang.String methodName)
createAverageDataSource in interface DataSourceRecordername - the name for this data source. This corresponds to the column
name when this object is written out to the filefeedFrom - the list of object on which to call the methodmethodName - the name of the method to call. This method should return
some sub class of java.lang.Number
public void createAverageDataSource(java.lang.String name,
java.util.ArrayList feedFrom,
java.lang.String methodName,
int maxIntegerDigits,
int maxFractionDigits)
createAverageDataSource in interface DataSourceRecordername - the name for this data source. This corresponds to the column
name when this object is written out to the filefeedFrom - the list of object on which to call the methodmethodName - the name of the method to call. This method should return
some sub class of java.lang.Numberpublic void record()
record in interface Recorderpublic void write()
write in interface Recorderpublic void writeToFile()
writeToFile in interface Recorderpublic void writeEnd()
writeEnd in interface Recorderpublic void simEventPerformed(SimEvent evt)
simEventPerformed in interface RecordersimEventPerformed in interface SimEventListenerpublic void setDelimeter(java.lang.String delimeter)
setDelimeter in interface DataSourceRecorderdelimeter - the new delimiter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||