Class Checkpoints

java.lang.Object
org.moeaframework.core.PeriodicAction
org.moeaframework.algorithm.Checkpoints
All Implemented Interfaces:
Extensible, Algorithm, Stateful

@Deprecated public class Checkpoints extends PeriodicAction
Deprecated.
Use CheckpointExtension instead
Decorates an Algorithm to periodically save checkpoint files from which the algorithm can resume itself if unexpectedly terminated.
   File stateFile = new File("last.state");
 
   Algorithm algorithm = new Checkpoints(new NSGAII(...), stateFile, 100);
 
   while (!algorithm.isTerminated()) {
     algorithm.step();
   }
 
  • Constructor Details

    • Checkpoints

      public Checkpoints(Algorithm algorithm, File stateFile, int checkpointFrequency)
      Deprecated.
      Decorates an algorithm to periodically save checkpoints from which the algorithm can resume itself if unexpectedly terminated.
      Parameters:
      algorithm - the algorithm
      stateFile - the file containing the checkpoint states
      checkpointFrequency - the number of objective function evaluations between checkpoints
  • Method Details

    • doAction

      public void doAction()
      Deprecated.
      Description copied from class: 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.
      Specified by:
      doAction in class PeriodicAction
    • terminate

      public void terminate()
      Deprecated.
      Description copied from interface: Algorithm
      Called when the termination condition is reached and the run is complete. This method is automatically called when using Algorithm.run(TerminationCondition), but can also be invoked directly if executing the algorithm step-by-step with Algorithm.step().

      Implementations should always call super.terminate() to ensure the algorithm is terminated correctly.

      Specified by:
      terminate in interface Algorithm
      Overrides:
      terminate in class PeriodicAction