Class CheckpointExtension

java.lang.Object
org.moeaframework.algorithm.extension.PeriodicExtension
org.moeaframework.algorithm.extension.CheckpointExtension
All Implemented Interfaces:
Extension, Stateful

public class CheckpointExtension extends PeriodicExtension
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.
  • Constructor Details

    • CheckpointExtension

      public CheckpointExtension(File stateFile, int frequency)
      Creates a new checkpoint extension.
      Parameters:
      stateFile - the file containing the checkpoint states
      frequency - the number of objective function evaluations between checkpoints
    • CheckpointExtension

      public CheckpointExtension(File stateFile, int frequency, FrequencyType frequencyType)
      Creates a new checkpoint extension.
      Parameters:
      stateFile - the file containing the checkpoint states
      frequency - the frequency of checkpoints
      frequencyType - the type of frequency
  • Method Details

    • doAction

      public void doAction(Algorithm algorithm)
      Description copied from class: PeriodicExtension
      The action that is called by this extension.
      Specified by:
      doAction in class PeriodicExtension
      Parameters:
      algorithm - the algorithm associated with this extension
    • onRegister

      public void onRegister(Algorithm algorithm)
      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 interface Extension
      Overrides:
      onRegister in class PeriodicExtension
      Parameters:
      algorithm - the algorithm associated with this extension
    • onTerminate

      public void onTerminate(Algorithm algorithm)
      Description copied from interface: Extension
      Called after the termination of an algorithm.
      Parameters:
      algorithm - the algorithm associated with this extension