net.lenkaspace.creeper.report
Class CRWorldSnapshotReport

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

public class CRWorldSnapshotReport
extends CRBaseReport

Creates graphical snapshots of the world at specified times / intervals and saves them to the report folder.

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

Constructor Summary
CRWorldSnapshotReport(java.lang.String title_, java.awt.Dimension size_, int snapshotFrequency_)
          Constructor
CRWorldSnapshotReport(java.lang.String title_, java.awt.Dimension size_, int[] snapshotTimeUnits_)
          Constructor
 
Method Summary
 void createSelf(java.lang.String printToFileName_, boolean show_)
          Create a window of the report.
 void onTrialEnd(int trialNumber_, int runNumber_)
          Called by CRController each time a trial ends.
 void onUpdateLoopEnd(int timeCounter_, int timeUnit_)
          Called from CRController after onUpdateLoopEnd() of all world objects is called.
 
Methods inherited from class net.lenkaspace.creeper.report.CRBaseReport
display, getDisplaysWindow, getFileName, onRunEnd, onRunStart, onSimulationEnd, onSimulationStart, onTrialStart, onUpdateLoopStart, setController, setReportController
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRWorldSnapshotReport

public CRWorldSnapshotReport(java.lang.String title_,
                             java.awt.Dimension size_,
                             int[] snapshotTimeUnits_)
Constructor

Parameters:
title_ - String title of the report
size_ - Dimension size of the report window
snapshotTimeUnits_ - ArrayList list of time units at which to save world snapshots

CRWorldSnapshotReport

public CRWorldSnapshotReport(java.lang.String title_,
                             java.awt.Dimension size_,
                             int snapshotFrequency_)
Constructor

Parameters:
title_ - String title of the report
size_ - Dimension size of the report window
snapshotFrequency_ - int frequency in time units at which snapshots will be saved. Must be > 0.
Method Detail

onUpdateLoopEnd

public void onUpdateLoopEnd(int timeCounter_,
                            int timeUnit_)
Called from CRController after onUpdateLoopEnd() of all world objects is called. Creates a snapshot of the world if at a specified time unit

Overrides:
onUpdateLoopEnd in class CRBaseReport
Parameters:
timeUnit_ - int current time unit
timeCounter_ - int current time counter, i.e. part of the timeUnit_

onTrialEnd

public void onTrialEnd(int trialNumber_,
                       int runNumber_)
Called by CRController each time a trial ends. Creates the final snapshot of the world

Overrides:
onTrialEnd in class CRBaseReport
Parameters:
trialNumber_ - int ending trial number
runNumber_ - int current run number

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