Decorates an Algorithm to periodically save checkpoint files from
which the algorithm can resume itself if unexpectedly terminated.
File stateFile = new File("last.state");
//if last.state exists, algorithm will be restored to last state
Algorithm algorithm = new Checkpoints(new NSGAII(...), stateFile, 100);
while (!algorithm.isTerminated()) {
algorithm.step(); //periodically saves state to last.state
}
Nested Class Summary
Nested classes/interfaces inherited from class org.moeaframework.algorithm.PeriodicAction
Checkpoints(Algorithm algorithm,
File stateFile,
int checkpointFrequency)
Decorates an algorithm to periodically save checkpoints from which the
algorithm can resume itself if unexpectedly terminated.
Method Summary
void
doAction()
Invoked periodically by this class to perform some function.
Methods inherited from class org.moeaframework.algorithm.PeriodicAction
Invoked periodically by this class to perform some function. This
function should not depend on the frequency that it is invoked, since
it is not guaranteed that this method is invoked at any specific
frequency and, in some cases, may not be invoked at all.