Class ProgressExtension

java.lang.Object
org.moeaframework.algorithm.extension.ProgressExtension
All Implemented Interfaces:
Extension

public class ProgressExtension extends Object implements Extension
Extends an algorithm to track and report progress.
  • Constructor Details

    • ProgressExtension

      public ProgressExtension()
      Constructs a new extension for tracking progress.
  • Method Details

    • onRun

      public void onRun(Algorithm algorithm, TerminationCondition terminationCondition)
      Description copied from interface: Extension
      Called when starting a new run of the algorithm. This can be used to check the termination conditions.
      Specified by:
      onRun in interface Extension
      Parameters:
      algorithm - the algorithm associated with this extension
      terminationCondition - the termination condition used for the run
    • onStep

      public void onStep(Algorithm algorithm)
      Description copied from interface: Extension
      Called after each step of the algorithm.
      Specified by:
      onStep in interface Extension
      Parameters:
      algorithm - the algorithm associated with this extension
    • onInitialize

      public void onInitialize(Algorithm algorithm)
      Description copied from interface: Extension
      Called when an algorithm is being initialized.
      Specified by:
      onInitialize in interface Extension
      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.
      Specified by:
      onTerminate in interface Extension
      Parameters:
      algorithm - the algorithm associated with this extension
    • withListener

      public ProgressExtension withListener(ProgressExtension.ProgressListener listener)
      Adds the given listener to receive progress reports.
      Parameters:
      listener - the listener to receive progress reports
      Returns:
      a reference to this extension
    • addListener

      public void addListener(ProgressExtension.ProgressListener listener)
      Adds the given listener to receive progress reports.
      Parameters:
      listener - the listener to receive progress reports
    • removeListener

      public void removeListener(ProgressExtension.ProgressListener listener)
      Removes the given listener so it no longer receives progress reports.
      Parameters:
      listener - the listener to no longer receive progress reports