Class TerminateByDistancePercAvgDynamicG

java.lang.Object
se.liu.ida.hefquin.engine.queryproc.impl.poptimizer.evolutionaryAlgorithm.TerminationCriterionBase
se.liu.ida.hefquin.engine.queryproc.impl.poptimizer.evolutionaryAlgorithm.TerminateByDistancePercAvgDynamicG
All Implemented Interfaces:
TerminationCriterion

public class TerminateByDistancePercAvgDynamicG extends TerminationCriterionBase
Distance-based termination criterion: Termination is triggered when the relative distance between the average cost in the current generation and in the previous generation has not exceeded a specified distance threshold for a number of generations. (The nrGenerations is a dynamic number depending on the number of lowest-cost plans).
  • Field Details

    • percAvgThreshold

      protected final double percAvgThreshold
  • Constructor Details

    • TerminateByDistancePercAvgDynamicG

      public TerminateByDistancePercAvgDynamicG(double percAvgThreshold, LogicalPlan plan)
  • Method Details

    • getFactory

      public static TerminationCriterionFactory getFactory(double percAvgThreshold)
    • readyToTerminate

      public boolean readyToTerminate(Generation currentGeneration, List<Generation> allPreviousGenerations)
      Description copied from interface: TerminationCriterion
      Returns true if this termination criterion has been reached with the current generation.
      Parameters:
      currentGeneration - the current generation for which the termination criterion is test
      allPreviousGenerations - a list of all previous generations, in the order in which they have been created