|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.analysis.ObjectDataRecorder
public class ObjectDataRecorder
Records Objects to files as Strings. ObjectDataRecorder will record Objects together with an optional String comment. Typically, this comment will be the tick count, but need not be.
In non-batch mode, a file header will be written that includes all the model's properties and the values of these properties. These values will be the value at the time the first call to write is made, allowing the user to manipulate the parameters after setting up but prior to running the model. Consequently, your initial model parameters should only be changeable via the user or through a parameter file. If not, the file header may be inaccurate. The actual data will be written as a block where the block includes the optional comment as a header, followed by the String representation of the Object itself.
In batch mode, any constant model parameters will be written in the file header. The data block will include the value of any dynamic parameters, the run number, as well as the optional comment (again, typically the tick count), together with the String representation of the Object to be recorded.
| Nested Class Summary | |
|---|---|
protected class |
ObjectDataRecorder.ObjectStringPair
|
| Field Summary | |
|---|---|
protected java.util.Vector |
data
|
protected DataFileHeader |
dfHeader
|
protected java.lang.String |
lineSep
|
protected DataFileWriter |
writer
|
| Constructor Summary | |
|---|---|
ObjectDataRecorder(java.lang.String fileName,
SimModel model)
Creates a new ObjectDataRecorder. |
|
ObjectDataRecorder(java.lang.String fileName,
java.lang.String modelHeader)
Creates a new ObjectDataRecorder. |
|
| Method Summary | |
|---|---|
void |
record(java.lang.Object o)
Records the specified object. |
void |
record(java.lang.Object o,
java.lang.String comment)
Records the specified Object together with the comment. |
void |
write()
Writes all the recorded data (ie Objects) to the file specified in the constructor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Vector data
protected DataFileHeader dfHeader
protected java.lang.String lineSep
protected DataFileWriter writer
| Constructor Detail |
|---|
public ObjectDataRecorder(java.lang.String fileName,
SimModel model)
fileName - the name of the file to record objects to.model - the model associated with this ObjectDataRecorder
public ObjectDataRecorder(java.lang.String fileName,
java.lang.String modelHeader)
fileName - the name of the file to record objects to.modelHeader - user provided header| Method Detail |
|---|
public void record(java.lang.Object o,
java.lang.String comment)
o - the object to recordcomment - a comment about the objectpublic void record(java.lang.Object o)
o - the object to recordpublic void write()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||