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
Nested ClassesModifier and TypeClassDescriptionstatic classDefault progress listener that displays information to standard output.static classA progress event, including the percent complete, elapsed time, and estimated remaining time.static interfaceInterface used to listen for progress reports provided by this extension. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given listener to receive progress reports.voidonInitialize(Algorithm algorithm) Called when an algorithm is being initialized.voidonRun(Algorithm algorithm, TerminationCondition terminationCondition) Called when starting a new run of the algorithm.voidCalled after each step of the algorithm.voidonTerminate(Algorithm algorithm) Called after the termination of an algorithm.voidRemoves 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, waitMethods 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:ExtensionCalled when starting a new run of the algorithm. This can be used to check the termination conditions. -
onStep
Description copied from interface:ExtensionCalled after each step of the algorithm. -
onInitialize
Description copied from interface:ExtensionCalled when an algorithm is being initialized.- Specified by:
onInitializein interfaceExtension- Parameters:
algorithm- the algorithm associated with this extension
-
onTerminate
Description copied from interface:ExtensionCalled after the termination of an algorithm.- Specified by:
onTerminatein 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
-