net.lenkaspace.creeper.report
Class CRReportController

java.lang.Object
  extended by net.lenkaspace.creeper.report.CRReportController

public class CRReportController
extends java.lang.Object

Maintains and provides all reports

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

Constructor Summary
CRReportController(CRController controller_)
          Constructor
 
Method Summary
 void addReport(java.lang.String reportName_, CRBaseReport report_)
          Add a new report
 java.lang.String getBaseFolderName()
          Return name of the folder where all report folders will be created.
 java.lang.String getCurrentFilePath()
          Get where reports are current being saved, taking into account report folder name, current run and trial
 CRBaseReport getReport(java.lang.String reportName_)
          Get a report of a specific unique name
 java.lang.String getReportFolderName()
           
 java.lang.String[] getReportNames(boolean displayableOnly_)
          Get all registered report names
 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 setBaseFolderName(java.lang.String folderName_)
          Set name of the folder where all report folders will be created.
 void setController(CRController controller_)
          Set reference to the controller and pass it to all reports
 void setReportFolderName(java.lang.String value_)
          Set where reports will be saved automatically
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRReportController

public CRReportController(CRController controller_)
Constructor

Parameters:
controller_ - CRController holding controller instance
Method Detail

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 and call onNewTrial of children models.

Parameters:
runNumber_ - int new run number

onRunEnd

public void onRunEnd(int runNumber_)
Called by CRController each time a run ends. Use 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 models.

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. Saves all reports into a folder.

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

addReport

public void addReport(java.lang.String reportName_,
                      CRBaseReport report_)
Add a new report

Parameters:
reportName_ - String a unique report name
report_ - CRBaseReport instance of a CRBaseReport subclass report

getReportNames

public java.lang.String[] getReportNames(boolean displayableOnly_)
Get all registered report names

Parameters:
displayableOnly_ - boolean if true, only return a list of reports that display a window when called
Returns:
String[] report names

getReport

public CRBaseReport getReport(java.lang.String reportName_)
Get a report of a specific unique name

Parameters:
reportName_ - String report name
Returns:
CRBaseReport instance of a CRBaseReport subclass

setController

public void setController(CRController controller_)
Set reference to the controller and pass it to all reports

Parameters:
controller_ - CRController controller

setReportFolderName

public void setReportFolderName(java.lang.String value_)
Set where reports will be saved automatically

Parameters:
value_ - String report folder name

getReportFolderName

public java.lang.String getReportFolderName()

getCurrentFilePath

public java.lang.String getCurrentFilePath()
Get where reports are current being saved, taking into account report folder name, current run and trial

Returns:
String current file path

getBaseFolderName

public java.lang.String getBaseFolderName()
Return name of the folder where all report folders will be created. Default is "bin".

Returns:
String folder name

setBaseFolderName

public void setBaseFolderName(java.lang.String folderName_)
Set name of the folder where all report folders will be created. If folder doesn't exist, it will be created

Parameters:
folderName_ - String folder name