Class AbstractCostConverger

java.lang.Object
com.dna.jopt.util.costconverger.AbstractCostConverger
All Implemented Interfaces:
ICostConverger
Direct Known Subclasses:
JoinedCostConverger, JoinedCostConvergerWithFinalAutoFilterStep

public abstract class AbstractCostConverger extends Object implements ICostConverger
A converger allows to set after which amount of unchanged progress the IOptimization is stopped.
Since:
03/08/2019
Version:
03/08/2019
Author:
DNA
  • Constructor Details

    • AbstractCostConverger

      protected AbstractCostConverger(IOptimization opti)
  • Method Details

    • setOnConvergedTimeOut

      public void setOnConvergedTimeOut(long onConvergedtimeout, TimeUnit onConvergedTimeUnit)
      Specified by:
      setOnConvergedTimeOut in interface ICostConverger
    • setConvergenceThreshold

      public void setConvergenceThreshold(int numProgressSteps)
      Description copied from interface: ICostConverger
      Sets the convergence threshold X. If the convergence cost did not change for X iterations in % the converger stops the optimizations.
      Specified by:
      setConvergenceThreshold in interface ICostConverger
      Parameters:
      numProgressSteps - the new convergence threshold
    • addExecutionAlgorithm

      public void addExecutionAlgorithm(String exectutionAlgo)
      Description copied from interface: ICostConverger
      Defines where the Optimization can be stopped by the Converger. For implementation example please see ICostConverger.

      Possible values are "GeneticEvolution" and "SimulatedAnnealing".

      Specified by:
      addExecutionAlgorithm in interface ICostConverger
      Parameters:
      exectutionAlgo - the string of the algorithm in which the optimization can be stopped safely
    • onDone

      public void onDone(IOptimization opti)
      Specified by:
      onDone in interface ICostConverger
    • onConverged

      public CompletableFuture<Void> onConverged(IOptimization opti)
      Specified by:
      onConverged in interface ICostConverger