|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.brook.ascape.view.NonGraphicView
|
+--edu.brook.ascape.view.DataView
|
+--edu.brook.ascape.view.DataOutputView
A non-graphic view providing output of model data to a file. To use, (assuming you are collecting the statistics you are interested in, see Scape) just add this view to any scape, and set a file or data strem for it. Every period, statistic measurements will be written to the file or data strem. By default, all statistics are selected; get data selection to make different selections. If you would like to add more information to the period or run data, simply override the write.. methods. The rule here is that all fields must be preceeded by the '\t' character. (Of course, the first field should not be preceeded with a tab character, but ordinarily you will be calling the super method first anyway.) If you do override either writeRunData or writePeriodData, be sure to override writeRunHeader or writePeriodHeader as well.
DataView,
SweepGroup,
SweepControlView,
Scape| Field Summary | |
protected static int |
numCharsInFileName
The number of characters to use for a file name. |
protected java.io.DataOutputStream |
periodDataStream
The data stream statistics are written to. |
protected java.io.File |
periodFile
|
protected java.io.FileOutputStream |
periodFileStream
The file stream statistics are written to. |
protected java.io.DataOutputStream |
runDataStream
The data stream statistics are written to. |
protected java.io.File |
runFile
|
protected java.io.FileOutputStream |
runFileStream
The file stream statistics are written to. |
protected long |
startTime
The time the current run was started. |
| Fields inherited from class edu.brook.ascape.view.DataView |
dataSelection |
| Fields inherited from class edu.brook.ascape.view.NonGraphicView |
name,
scape |
| Constructor Summary | |
DataOutputView()
Constructs a data output view. |
|
DataOutputView(java.io.DataOutputStream runDataStream)
Constructs a data output view. |
|
DataOutputView(java.io.File file)
Constructs a data output view. |
|
| Method Summary | |
void |
addScape(Scape scape)
Add a scape to the view. |
int |
getNumCharsInFileName()
Returns the number of characters used for the sequential file name. |
java.io.DataOutputStream |
getPeriodDataStream()
Returns the data stream that period (iteration by iteration) output will be written to. |
java.io.File |
getPeriodFile()
|
java.io.DataOutputStream |
getRunDataStream()
Returns the data stream that statistics output should go to. |
java.io.File |
getRunFile()
Returns the file that the run output will be written to. |
void |
onClose()
On close, closes any open files. |
void |
onStart()
On scape start, record the start time and wirte the file headers. |
void |
onStop()
On scape stop, writes the run results to the file. |
void |
onUpdate()
On scape update, call writePeriodData. |
void |
setNumCharsInFileName(int runLimit)
Sets the number of characters to use for the sequential file name. |
void |
setPeriodDataStream(java.io.DataOutputStream periodDataStream)
Defines the data stream that period (iteration by iteration) output will be written to. |
void |
setPeriodFile(java.io.File file)
Defines the file that period (iteration by iteeration) output will be written to. |
void |
setRunDataStream(java.io.DataOutputStream runDataStream)
Defines the data stream that run output will be written to. |
void |
setRunFile(java.io.File file)
Defines the file that run output will be written to. |
boolean |
stopCondition()
(Conveneince method.) If this method returns true, the current run will be stopped. |
java.lang.String |
toString()
|
void |
writePeriodData()
Writes the current period statistics to the data stream or file. |
void |
writePeriodHeader()
Writes the headers for the period statistics to the run data stream or file. |
void |
writeRunData()
Writes the current run results to the data stream or file. |
void |
writeRunHeader()
Writes the headers for the run results to the run data stream or file. |
| Methods inherited from class edu.brook.ascape.view.DataView |
getDataSelection |
| Methods inherited from class edu.brook.ascape.view.NonGraphicView |
getName,
getScape,
NonGraphicView,
NonGraphicView,
onIterate,
onSetup,
removeScape,
scapeUpdated,
setName |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected static int numCharsInFileName
protected long startTime
protected java.io.File runFile
protected java.io.FileOutputStream runFileStream
protected java.io.DataOutputStream runDataStream
protected java.io.File periodFile
protected java.io.FileOutputStream periodFileStream
protected java.io.DataOutputStream periodDataStream
| Constructor Detail |
public DataOutputView()
public DataOutputView(java.io.DataOutputStream runDataStream)
runDataStream - the stream to write the data to
public DataOutputView(java.io.File file)
throws java.io.IOException
file - the file to write the data to| Method Detail |
public java.io.DataOutputStream getRunDataStream()
runDataStream - the stream to write the data topublic void setRunDataStream(java.io.DataOutputStream runDataStream)
runDataStream - the stream to write the data topublic java.io.File getRunFile()
runDataStream - the stream to write the data to
public void setRunFile(java.io.File file)
throws java.io.IOException
file - the file to write the data topublic java.io.DataOutputStream getPeriodDataStream()
runDataStream - the stream to write the data topublic void setPeriodDataStream(java.io.DataOutputStream periodDataStream)
runDataStream - the stream to write the data topublic java.io.File getPeriodFile()
public void setPeriodFile(java.io.File file)
throws java.io.IOException
file - the file to write the data to
public void writePeriodHeader()
throws java.io.IOException
public void writePeriodData()
throws java.io.IOException
public void writeRunHeader()
throws java.io.IOException
public void writeRunData()
throws java.io.IOException
public boolean stopCondition()
public int getNumCharsInFileName()
public void setNumCharsInFileName(int runLimit)
public void onUpdate()
public void onClose()
public void onStart()
public void onStop()
onStart(),
onStop()
public void addScape(Scape scape)
throws java.util.TooManyListenersException
scape - the scape to make this canvas the observer ofpublic java.lang.String toString()
|
(c) 1998-2000 The Brookings Insitution Webpage |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||