net.lenkaspace.creeper.report
Class CRCsvReport

java.lang.Object
  extended by net.lenkaspace.creeper.report.CRBaseReport
      extended by net.lenkaspace.creeper.report.CRCsvReport

public class CRCsvReport
extends CRBaseReport

Can create csv reports of the whole simulation and organize values as: Run1_Trial1_value1, Run1_Trial1_value2, Run1_Trial1_value3, ... Run2_Trial1_value1, Run2_Trial1_value2, Run2_Trial1_value3, ... ... Run1_Trial2_value1, Run1_Trial2_value2, Run1_Trial2_value3, ... Run2_Trial2_value1, Run2_Trial2_value2, Run2_Trial2_value3, ... For better performance, maintain an instance that opens and closes with (updated) data rather than creating a new popup every time.

Version:
2.0
Author:
Lenka Pitonakova contact@lenkaspace.net

Constructor Summary
CRCsvReport(java.lang.String title_, java.lang.String[] variableNames_, java.awt.Dimension size_)
          Constructor
 
Method Summary
 void addValue(java.lang.String variableName_, double value_)
          Put a new value for a specific trial, run and variable name to the value set
 void addValue(java.lang.String variableName_, java.lang.String value_)
          Put a new value for a specific trial, run and variable name to the value set
 void addValue(java.lang.String variableName_, java.lang.String value_, int trialNumber_, int runNumber_)
          Put a new value for a specific trial, run and variable name to the value set
 void addValueSet(double[] values_)
          Put array of values for a specific trial and run to the value set The value set size should be the same as size of set names the report was initialised with.
 void addValueSet(double[] values_, int trialNumber_, int runNumber_)
          Put array of values for a specific trial and run to the value set The value set size should be the same as size of set names the report was initialised with.
 void addValueSet(java.lang.String[] values_)
          Put array of values for a specific trial and run to the value set The value set size should be the same as size of set names the report was initialised with.
 void addValueSet(java.lang.String[] values_, int trialNumber_, int runNumber_)
          Put array of values for a specific trial and run to the value set The value set size should be the same as size of set names the report was initialised with.
 void createSelf(java.lang.String printToFileName_, boolean show_)
          Create a window of the report.
 void onSimulationEnd()
          Called by CRController each time a simulation ends Use this to save any simulation-persisting data
 void onSimulationStart()
          Called by CRController each time a new simulation starts Use this to reset any simulation-persisting data
 
Methods inherited from class net.lenkaspace.creeper.report.CRBaseReport
display, getDisplaysWindow, getFileName, onRunEnd, onRunStart, onTrialEnd, onTrialStart, onUpdateLoopEnd, onUpdateLoopStart, setController, setReportController
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRCsvReport

public CRCsvReport(java.lang.String title_,
                   java.lang.String[] variableNames_,
                   java.awt.Dimension size_)
Constructor

Parameters:
title_ - String title of the report
variableNames_ - String array of variable names to identify different sets
size_ - Dimension size of the report window
Method Detail

onSimulationStart

public void onSimulationStart()
Called by CRController each time a new simulation starts Use this to reset any simulation-persisting data

Overrides:
onSimulationStart in class CRBaseReport

onSimulationEnd

public void onSimulationEnd()
Called by CRController each time a simulation ends Use this to save any simulation-persisting data

Overrides:
onSimulationEnd in class CRBaseReport

addValueSet

public void addValueSet(double[] values_)
Put array of values for a specific trial and run to the value set The value set size should be the same as size of set names the report was initialised with.

Parameters:
values_ - double[] array of values

addValueSet

public void addValueSet(double[] values_,
                        int trialNumber_,
                        int runNumber_)
Put array of values for a specific trial and run to the value set The value set size should be the same as size of set names the report was initialised with.

Parameters:
values_ - double[] array of values
trialNumber_ - int trial number <1;totalTrials>
runNumber_ - int run number <1;totalRuns>

addValueSet

public void addValueSet(java.lang.String[] values_)
Put array of values for a specific trial and run to the value set The value set size should be the same as size of set names the report was initialised with.

Parameters:
values_ - String[] array of values

addValueSet

public void addValueSet(java.lang.String[] values_,
                        int trialNumber_,
                        int runNumber_)
Put array of values for a specific trial and run to the value set The value set size should be the same as size of set names the report was initialised with.

Parameters:
values_ - String[] array of values

addValue

public void addValue(java.lang.String variableName_,
                     double value_)
Put a new value for a specific trial, run and variable name to the value set

Parameters:
variableName_ - String new value name
value_ - double new value

addValue

public void addValue(java.lang.String variableName_,
                     java.lang.String value_)
Put a new value for a specific trial, run and variable name to the value set

Parameters:
variableName_ - String new value name
value_ - String new value

addValue

public void addValue(java.lang.String variableName_,
                     java.lang.String value_,
                     int trialNumber_,
                     int runNumber_)
Put a new value for a specific trial, run and variable name to the value set

Parameters:
variableName_ - String new value name
value_ - String new value
trialNumber_ - int trial number <1;totalTrials>
runNumber_ - int run number <1;totalRuns>

createSelf

public void createSelf(java.lang.String printToFileName_,
                       boolean show_)
Create a window of the report. Optionally show it on screen as well

Overrides:
createSelf in class CRBaseReport
Parameters:
printToFileName_ - String file name to print report into, without extension
show_ - boolean if false, report is hidden immediately after printed