Class CheckpointExtension
java.lang.Object
org.moeaframework.algorithm.extension.PeriodicExtension
org.moeaframework.algorithm.extension.CheckpointExtension
Adds checkpoint functionality to an algorithm where the state is periodically recorded in a state file. If the
state file exists at the start of the run, the algorithm is restored and resumes from that point.
-
Field Summary
Fields inherited from class org.moeaframework.algorithm.extension.PeriodicExtension
frequency, iteration, lastInvocation -
Constructor Summary
ConstructorsConstructorDescriptionCheckpointExtension(File stateFile, Frequency frequency) Creates a new checkpoint extension. -
Method Summary
Modifier and TypeMethodDescriptionvoidThe action that is called by this extension.voidonRegister(Algorithm algorithm) Called when this extension is registered with an algorithm.voidonTerminate(Algorithm algorithm) Called after the termination of an algorithm.Methods inherited from class org.moeaframework.algorithm.extension.PeriodicExtension
loadState, onStep, saveStateMethods 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
onInitialize, onRun
-
Constructor Details
-
CheckpointExtension
Creates a new checkpoint extension.- Parameters:
stateFile- the file containing the checkpoint statesfrequency- the frequency of checkpoints
-
-
Method Details
-
doAction
Description copied from class:PeriodicExtensionThe action that is called by this extension.- Specified by:
doActionin classPeriodicExtension- Parameters:
algorithm- the algorithm associated with this extension
-
onRegister
Description copied from interface:ExtensionCalled when this extension is registered with an algorithm. This can be used to perform any type checking or initialization.- Specified by:
onRegisterin interfaceExtension- Overrides:
onRegisterin classPeriodicExtension- Parameters:
algorithm- the algorithm associated with this extension
-
onTerminate
Description copied from interface:ExtensionCalled after the termination of an algorithm.- Parameters:
algorithm- the algorithm associated with this extension
-