|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.primordion.xholon.io.AbstractChartViewer org.primordion.xholon.io.ChartViewerGnuplot
Captures data, and creates a script to display the data in a gnuplot chart.
Data is captured by writing data points to a file at each time step. The file is in comma delimited .csv format, and can therefore be processed by various applications, including Microsoft Excel, and gnuplot. In addition to writing out the data, this class also produces a gnuplot script file that will generate a .png file from the data. You can download gnuplot free from www.gnuplot.info. On a Windows computer, if you double-click the .csv file, it will be directly loaded into Excel as a spreadsheet, from which you can easily generate a chart. Data and script files are written by default to the statistics directory.
Field Summary |
Fields inherited from interface org.primordion.xholon.io.IChartViewer |
WRITE_AS_DOUBLE, WRITE_AS_FLOAT, WRITE_AS_INT, WRITE_AS_LONG, WRITE_AS_NULL, WRITE_AS_SHORT, WRITE_TIME_IN_HEADING |
Constructor Summary | |
ChartViewerGnuplot(IXholon chartRoot,
int nameConcatLevels,
java.lang.String pathName,
java.lang.String typeOfData,
int writeType)
constructor |
Method Summary | |
void |
capture(double timeStep)
Capture data at each timestep. |
void |
capture(int numTimeSeries,
double xVal,
double[] yVal)
Capture specified data at each time interval. |
void |
chart()
Produce a chart from the captured data. |
void |
chart(boolean showLegend)
Produce a chart from the captured data. |
void |
createNotes()
Create a notes file that can be used by a human to capture observations as the simulation is running. |
void |
createXySeries(int seriesCount,
java.lang.String[] seriesName)
Create one or more xy data series. |
void |
initialize(IXholon chartRoot,
int nameConcatLevels)
Initialize the chart viewer. |
void |
remove()
Remove the chart from the screen. |
Methods inherited from class org.primordion.xholon.io.AbstractChartViewer |
setXRange, setYFormat, setYRange |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.primordion.xholon.io.IChartViewer |
setXRange, setYFormat, setYRange |
Constructor Detail |
public ChartViewerGnuplot(IXholon chartRoot, int nameConcatLevels, java.lang.String pathName, java.lang.String typeOfData, int writeType)
chartRoot
- XYChart node.nameConcatLevels
- Number of composite levels to concatenate in deriving series name.pathName
- Path in which data and plot files will be created.typeOfData
- The type of data will be included as part of the file name.writeType
- Method Detail |
public void initialize(IXholon chartRoot, int nameConcatLevels)
IChartViewer
initialize
in interface IChartViewer
chartRoot
- XYChart node.nameConcatLevels
- Number of composite levels to concatenate in deriving series name.public void createXySeries(int seriesCount, java.lang.String[] seriesName)
IChartViewer
createXySeries
in interface IChartViewer
seriesCount
- Number of xy series.seriesName
- Name of each xy series.public void capture(double timeStep)
IChartViewer
capture
in interface IChartViewer
capture
in class AbstractChartViewer
public void capture(int numTimeSeries, double xVal, double[] yVal)
IChartViewer
capture
in interface IChartViewer
capture
in class AbstractChartViewer
public void chart()
IChartViewer
chart
in interface IChartViewer
chart
in class AbstractChartViewer
public void chart(boolean showLegend)
IChartViewer
chart
in interface IChartViewer
showLegend
- Whether or not to show the legend. The legend shows the name and color of all data series.
If there are a lot of different series, then the legend can get too big.public void createNotes()
public void remove()
IChartViewer
remove
in interface IChartViewer
remove
in class AbstractChartViewer
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |