net.lenkaspace.creeper.report
Class CRBaseReport

java.lang.Object
  extended by net.lenkaspace.creeper.report.CRBaseReport
Direct Known Subclasses:
CRCsvReport, CRTimeSeriesReport, CRWorldSnapshotReport

public class CRBaseReport
extends java.lang.Object

A base report object of unspecified type. Provides interface and components for other report objects. 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
CRBaseReport(java.lang.String title_, java.awt.Dimension size_, boolean displaysWindow_)
          Constructor
 
Method Summary
 void createSelf(java.lang.String printToFileName_, boolean show_)
          Create a window of the report.
 void display()
          Display the report on screen in popup
 boolean getDisplaysWindow()
           
 java.lang.String getFileName()
           
 void onRunEnd(int runNumber_)
          Called by CRController each time a run ends.
 void onRunStart(int runNumber_)
          Called by CRController each time a run starts.
 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
 void onTrialEnd(int trialNumber_, int runNumber_)
          Called by CRController each time a trial ends.
 void onTrialStart(int trialNumber_, int runNumber_)
          Called by CRController each time a trial starts.
 void onUpdateLoopEnd(int timeCounter_, int timeUnit_)
          Called from CRController after onUpdateLoopEnd() of all world objects is called.
 void onUpdateLoopStart(int timeCounter_, int timeUnit_)
          Called from CRController before onUpdateLoopStart() of all world objects is called.
 void setController(CRController controller_)
           
 void setReportController(CRReportController reportController_)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRBaseReport

public CRBaseReport(java.lang.String title_,
                    java.awt.Dimension size_,
                    boolean displaysWindow_)
Constructor

Parameters:
title_ - String title of the report
size_ - Dimension size of the report window
displaysWindow_ - boolean if true, the report displays a window when its createSelf() is called
Method Detail

display

public void display()
Display the report on screen in popup


createSelf

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

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

onSimulationStart

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


onSimulationEnd

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


onRunStart

public void onRunStart(int runNumber_)
Called by CRController each time a run starts. Use this to reset self for a brand new simulation run and call onNewRun of children.

Parameters:
runNumber_ - int new run number

onRunEnd

public void onRunEnd(int runNumber_)
Called by CRController each time a run ends. User this to save any necessary data.

Parameters:
runNumber_ - int ending run number

onTrialStart

public void onTrialStart(int trialNumber_,
                         int runNumber_)
Called by CRController each time a trial starts. Use this to reset self for a new world environment and call onNewTrial of children.

Parameters:
trialNumber_ - int new trial number
runNumber_ - int new run number

onTrialEnd

public void onTrialEnd(int trialNumber_,
                       int runNumber_)
Called by CRController each time a trial ends. Use this to save any necessary data.

Parameters:
trialNumber_ - int ending trial number
runNumber_ - int current run number

onUpdateLoopStart

public void onUpdateLoopStart(int timeCounter_,
                              int timeUnit_)
Called from CRController before onUpdateLoopStart() of all world objects is called. Use this to reset any temporary variables.

Parameters:
timeCounter_ - int current time counter, i.e. part of the timeUnit_
timeUnit_ - int current time unit

onUpdateLoopEnd

public void onUpdateLoopEnd(int timeCounter_,
                            int timeUnit_)
Called from CRController after onUpdateLoopEnd() of all world objects is called. Use this to save any necessary data

Parameters:
timeCounter_ - int current time counter, i.e. part of the timeUnit_
timeUnit_ - int current time unit

setController

public void setController(CRController controller_)

getFileName

public java.lang.String getFileName()

setReportController

public void setReportController(CRReportController reportController_)

getDisplaysWindow

public boolean getDisplaysWindow()