Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mrd.analysis
Class AppendingDataRecorder  view AppendingDataRecorder download AppendingDataRecorder.java

java.lang.Object
  extended byorg.mrd.analysis.AppendingDataRecorder

public class AppendingDataRecorder
extends java.lang.Object


Field Summary
private  java.lang.String delim
           
private  org.apache.log4j.Logger log
           
private  SimModel model
           
private  java.util.Vector sources
           
(package private)  java.util.Vector v
           
 
Constructor Summary
AppendingDataRecorder(java.lang.String fileName, SimModel model, boolean isBatch, java.lang.String headerComment)
          Deprecated.  
 
Method Summary
 void addNumericDataSource(java.lang.String name, NumericDataSource s)
           
 void addNumericDataSource(java.lang.String name, NumericDataSource s, int maxIntegerDigits, int maxFractionDigits)
           
 void addObjectDataSource(java.lang.String name, DataSource s)
           
 void record()
          Records the data for the current tick in tabular format.
 void setDelimiter(java.lang.String delim)
          Sets the tabular data delimiter to the specified string.
 void simEventPerformed(SimEvent evt)
           
 void writeEnd()
          Writes any ending matter to the file.
 void writeToFile()
          Writes the recorded data out to a file in tabular format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sources

private java.util.Vector sources

model

private SimModel model

log

private org.apache.log4j.Logger log

delim

private java.lang.String delim

v

java.util.Vector v
Constructor Detail

AppendingDataRecorder

public AppendingDataRecorder(java.lang.String fileName,
                             SimModel model,
                             boolean isBatch,
                             java.lang.String headerComment)
Deprecated.  

Constructs a DataRecorder using the specified file name, model, and mode.

Method Detail

setDelimiter

public void setDelimiter(java.lang.String delim)
Sets the tabular data delimiter to the specified string. The default is ",".


addNumericDataSource

public void addNumericDataSource(java.lang.String name,
                                 NumericDataSource s,
                                 int maxIntegerDigits,
                                 int maxFractionDigits)

addNumericDataSource

public void addNumericDataSource(java.lang.String name,
                                 NumericDataSource s)

addObjectDataSource

public void addObjectDataSource(java.lang.String name,
                                DataSource s)

record

public void record()
Records the data for the current tick in tabular format. Each tick is a row, and each column is the name of the data source.


writeToFile

public void writeToFile()
Writes the recorded data out to a file in tabular format. This also does a flush on the data itself (i.e. the data is no longer stored by repast and exists only in the file). Identical to write().


writeEnd

public void writeEnd()
Writes any ending matter to the file. Used internally during a batch run to write the ending time of the entire batch. A model would not typically call this method.


simEventPerformed

public void simEventPerformed(SimEvent evt)