Class TerminateByDiversityDistBest
java.lang.Object
se.liu.ida.hefquin.engine.queryproc.impl.poptimizer.evolutionaryAlgorithm.TerminationCriterionBase
se.liu.ida.hefquin.engine.queryproc.impl.poptimizer.evolutionaryAlgorithm.TerminateByDiversityDistBest
- All Implemented Interfaces:
TerminationCriterion
Diversity-based termination criterion:
Similar to
TerminateByDiversityDistMax, but only the top-k plans with lowest cost within each generation are considered.
Termination is triggered when the relative difference between the cost of the best plan
and the top-k best plan within each generation has not exceeded
a specified distance threshold for a number of generations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final doubleprotected final doubleFields inherited from class se.liu.ida.hefquin.engine.queryproc.impl.poptimizer.evolutionaryAlgorithm.TerminationCriterionBase
nrGenerations -
Constructor Summary
ConstructorsConstructorDescriptionTerminateByDiversityDistBest(double distBestThreshold, double topK, LogicalPlan plan) -
Method Summary
Modifier and TypeMethodDescriptionstatic TerminationCriterionFactorygetFactory(double distBestThreshold, double topK) booleanreadyToTerminate(Generation currentGeneration, List<Generation> allPreviousGenerations) Returns true if this termination criterion has been reached with the current generation.Methods inherited from class se.liu.ida.hefquin.engine.queryproc.impl.poptimizer.evolutionaryAlgorithm.TerminationCriterionBase
calcFactorial, countNumOfOps
-
Field Details
-
distBestThreshold
protected final double distBestThreshold -
topK
protected final double topK
-
-
Constructor Details
-
TerminateByDiversityDistBest
-
-
Method Details
-
getFactory
-
readyToTerminate
public boolean readyToTerminate(Generation currentGeneration, List<Generation> allPreviousGenerations) Description copied from interface:TerminationCriterionReturns true if this termination criterion has been reached with the current generation.- Parameters:
currentGeneration- the current generation for which the termination criterion is testallPreviousGenerations- a list of all previous generations, in the order in which they have been created
-