Class ProgressExtension
java.lang.Object
org.moeaframework.algorithm.extension.ProgressExtension
- All Implemented Interfaces:
Extension
Extends an algorithm to track and report progress.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Default progress listener that displays information to standard output.static class
A progress event, including the percent complete, elapsed time, and estimated remaining time.static interface
Interface used to listen for progress reports provided by this extension. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given listener to receive progress reports.void
onInitialize
(Algorithm algorithm) Called when an algorithm is being initialized.void
onRun
(Algorithm algorithm, TerminationCondition terminationCondition) Called when starting a new run of the algorithm.void
Called after each step of the algorithm.void
onTerminate
(Algorithm algorithm) Called after the termination of an algorithm.void
Removes the given listener so it no longer receives progress reports.Adds the given listener to receive progress reports.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moeaframework.algorithm.extension.Extension
onRegister
-
Constructor Details
-
ProgressExtension
public ProgressExtension()Constructs a new extension for tracking progress.
-
-
Method Details
-
onRun
Description copied from interface:Extension
Called when starting a new run of the algorithm. This can be used to check the termination conditions. -
onStep
Description copied from interface:Extension
Called after each step of the algorithm. -
onInitialize
Description copied from interface:Extension
Called when an algorithm is being initialized.- Specified by:
onInitialize
in interfaceExtension
- Parameters:
algorithm
- the algorithm associated with this extension
-
onTerminate
Description copied from interface:Extension
Called after the termination of an algorithm.- Specified by:
onTerminate
in interfaceExtension
- Parameters:
algorithm
- the algorithm associated with this extension
-
withListener
Adds the given listener to receive progress reports.- Parameters:
listener
- the listener to receive progress reports- Returns:
- a reference to this extension
-
addListener
Adds the given listener to receive progress reports.- Parameters:
listener
- the listener to receive progress reports
-
removeListener
Removes the given listener so it no longer receives progress reports.- Parameters:
listener
- the listener to no longer receive progress reports
-