gov.sandia.cognition.algorithm.event
Class IterationMeasurablePerformanceReporter

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.algorithm.event.AbstractIterativeAlgorithmListener
          extended by gov.sandia.cognition.algorithm.event.IterationMeasurablePerformanceReporter
All Implemented Interfaces:
IterativeAlgorithmListener, CloneableSerializable, Serializable, Cloneable

public class IterationMeasurablePerformanceReporter
extends AbstractIterativeAlgorithmListener

An iterative algorithm listeners for MeasurablePerformanceAlgorithm objects that reports the performance of the algorithm at the end of each iteration.

Since:
3.3.3
Author:
Justin Basilico
See Also:
MeasurablePerformanceAlgorithm, IterativeAlgorithm, Serialized Form

Field Summary
static String DEFAULT_FORMAT
          The default format for reporting performance is "Iteration %d. %s: %s".
protected  String format
          The format for the performance report, passed to String.format.
protected  PrintStream out
          The print stream to report performance to.
 
Constructor Summary
IterationMeasurablePerformanceReporter()
          Creates a new IterationMeasurablePerformanceReporter that reports to System.out using the default format.
IterationMeasurablePerformanceReporter(PrintStream out)
          Creates a new IterationMeasurablePerformanceReporter that reports to the given print stream using the default format.
IterationMeasurablePerformanceReporter(PrintStream out, String format)
          Creates a new IterationMeasurablePerformanceReporter that reports to the given print stream and format.
IterationMeasurablePerformanceReporter(String format)
          Creates a new IterationMeasurablePerformanceReporter that reports to System.out and the given format.
 
Method Summary
 void stepEnded(IterativeAlgorithm algorithm)
          This method is called when the algorithm has ended a step of its execution.
 
Methods inherited from class gov.sandia.cognition.algorithm.event.AbstractIterativeAlgorithmListener
algorithmEnded, algorithmStarted, stepStarted
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FORMAT

public static final String DEFAULT_FORMAT
The default format for reporting performance is "Iteration %d. %s: %s".

See Also:
Constant Field Values

out

protected PrintStream out
The print stream to report performance to.


format

protected String format
The format for the performance report, passed to String.format.

Constructor Detail

IterationMeasurablePerformanceReporter

public IterationMeasurablePerformanceReporter()
Creates a new IterationMeasurablePerformanceReporter that reports to System.out using the default format.


IterationMeasurablePerformanceReporter

public IterationMeasurablePerformanceReporter(PrintStream out)
Creates a new IterationMeasurablePerformanceReporter that reports to the given print stream using the default format.

Parameters:
out - Print stream to report the status to.

IterationMeasurablePerformanceReporter

public IterationMeasurablePerformanceReporter(String format)
Creates a new IterationMeasurablePerformanceReporter that reports to System.out and the given format.

Parameters:
format - Format string for the status messages, which passed to String.format.

IterationMeasurablePerformanceReporter

public IterationMeasurablePerformanceReporter(PrintStream out,
                                              String format)
Creates a new IterationMeasurablePerformanceReporter that reports to the given print stream and format.

Parameters:
out - Print stream to report the status to.
format - Format string for the status messages, which passed to String.format.
Method Detail

stepEnded

public void stepEnded(IterativeAlgorithm algorithm)
Description copied from interface: IterativeAlgorithmListener
This method is called when the algorithm has ended a step of its execution.

Specified by:
stepEnded in interface IterativeAlgorithmListener
Overrides:
stepEnded in class AbstractIterativeAlgorithmListener
Parameters:
algorithm - The algorithm that has ended another step of its execution.