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, frequencyType, iteration, lastInvocation
-
Constructor Summary
ConstructorDescriptionCheckpointExtension
(File stateFile, int frequency) Creates a new checkpoint extension.CheckpointExtension
(File stateFile, int frequency, FrequencyType frequencyType) Creates a new checkpoint extension. -
Method Summary
Modifier and TypeMethodDescriptionvoid
The action that is called by this extension.void
onRegister
(Algorithm algorithm) Called when this extension is registered with an algorithm.void
onTerminate
(Algorithm algorithm) Called after the termination of an algorithm.Methods inherited from class org.moeaframework.algorithm.extension.PeriodicExtension
loadState, onStep, saveState
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
onInitialize
-
Constructor Details
-
CheckpointExtension
Creates a new checkpoint extension.- Parameters:
stateFile
- the file containing the checkpoint statesfrequency
- the number of objective function evaluations between checkpoints
-
CheckpointExtension
Creates a new checkpoint extension.- Parameters:
stateFile
- the file containing the checkpoint statesfrequency
- the frequency of checkpointsfrequencyType
- the type of frequency
-
-
Method Details
-
doAction
Description copied from class:PeriodicExtension
The action that is called by this extension.- Specified by:
doAction
in classPeriodicExtension
- Parameters:
algorithm
- the algorithm associated with this extension
-
onRegister
Description copied from interface:Extension
Called when this extension is registered with an algorithm. This can be used to perform any type checking or initialization.- Specified by:
onRegister
in interfaceExtension
- Overrides:
onRegister
in classPeriodicExtension
- Parameters:
algorithm
- the algorithm associated with this extension
-
onTerminate
Description copied from interface:Extension
Called after the termination of an algorithm.- Parameters:
algorithm
- the algorithm associated with this extension
-