public class IterationMeasurablePerformanceReporter extends AbstractIterativeAlgorithmListener
MeasurablePerformanceAlgorithm
objects that reports the performance of the algorithm at the end of each
iteration.MeasurablePerformanceAlgorithm
,
IterativeAlgorithm
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_FORMAT
The default format for reporting performance is "Iteration %d. %s: %s".
|
protected java.lang.String |
format
The format for the performance report, passed to String.format.
|
protected java.io.PrintStream |
out
The print stream to report performance to.
|
Constructor and Description |
---|
IterationMeasurablePerformanceReporter()
Creates a new
IterationMeasurablePerformanceReporter that
reports to System.out using the default format. |
IterationMeasurablePerformanceReporter(java.io.PrintStream out)
Creates a new
IterationMeasurablePerformanceReporter that
reports to the given print stream using the default format. |
IterationMeasurablePerformanceReporter(java.io.PrintStream out,
java.lang.String format)
Creates a new
IterationMeasurablePerformanceReporter that
reports to the given print stream and format. |
IterationMeasurablePerformanceReporter(java.lang.String format)
Creates a new
IterationMeasurablePerformanceReporter that
reports to System.out and the given format. |
Modifier and Type | Method and Description |
---|---|
void |
stepEnded(IterativeAlgorithm algorithm)
This method is called when the algorithm has ended a step of its
execution.
|
algorithmEnded, algorithmStarted, stepStarted
clone
public static final java.lang.String DEFAULT_FORMAT
protected java.io.PrintStream out
protected java.lang.String format
public IterationMeasurablePerformanceReporter()
IterationMeasurablePerformanceReporter
that
reports to System.out using the default format.public IterationMeasurablePerformanceReporter(java.io.PrintStream out)
IterationMeasurablePerformanceReporter
that
reports to the given print stream using the default format.out
- Print stream to report the status to.public IterationMeasurablePerformanceReporter(java.lang.String format)
IterationMeasurablePerformanceReporter
that
reports to System.out and the given format.format
- Format string for the status messages, which passed to
String.format
.public IterationMeasurablePerformanceReporter(java.io.PrintStream out, java.lang.String format)
IterationMeasurablePerformanceReporter
that
reports to the given print stream and format.out
- Print stream to report the status to.format
- Format string for the status messages, which passed to
String.format
.public void stepEnded(IterativeAlgorithm algorithm)
IterativeAlgorithmListener
stepEnded
in interface IterativeAlgorithmListener
stepEnded
in class AbstractIterativeAlgorithmListener
algorithm
- The algorithm that has ended another step of its execution.