Package org.apache.wayang.profiler.log
Class DynamicLoadEstimator
- java.lang.Object
-
- org.apache.wayang.core.optimizer.costs.LoadEstimator
-
- org.apache.wayang.profiler.log.DynamicLoadEstimator
-
public class DynamicLoadEstimator extends LoadEstimator
AdjustableLoadProfileEstimatorimplementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDynamicLoadEstimator.SinglePointEstimator-
Nested classes/interfaces inherited from class org.apache.wayang.core.optimizer.costs.LoadEstimator
LoadEstimator.SinglePointEstimationFunction
-
-
Field Summary
Fields Modifier and Type Field Description static DynamicLoadEstimatorzeroLoadInstance that always estimates a load of0.-
Fields inherited from class org.apache.wayang.core.optimizer.costs.LoadEstimator
nullCardinalityReplacement, UNSPECIFIED_NUM_SLOTS
-
-
Constructor Summary
Constructors Constructor Description DynamicLoadEstimator(DynamicLoadEstimator.SinglePointEstimator singlePointEstimator, java.util.function.Function<Individual,java.lang.String> specificationBuilder, java.util.Collection<Variable> employedVariables)Creates a new instance.DynamicLoadEstimator(DynamicLoadEstimator.SinglePointEstimator singlePointEstimator, java.util.function.Function<Individual,java.lang.String> specificationBuilder, Variable... employedVariables)Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LoadEstimatecalculate(EstimationContext context)Calculate theLoadEstimate.static DynamicLoadEstimatorcreateFor(java.lang.String templateKey, java.lang.String resource, java.lang.String expression, OptimizationSpace optimizationSpace)Parses a mathematical expression and provides it as aLoadEstimator.SinglePointEstimationFunction.java.util.Collection<Variable>getEmployedVariables()Get theVariables used in this instance.java.lang.StringtoMathEx(Individual individual)Creates a MathEx expression reflecting this instance under the configuration specified by anIndividual.-
Methods inherited from class org.apache.wayang.core.optimizer.costs.LoadEstimator
calculateJointProbability, createFallback, enumerateCombinations, replaceNullCardinality
-
-
-
-
Field Detail
-
zeroLoad
public static DynamicLoadEstimator zeroLoad
Instance that always estimates a load of0.
-
-
Constructor Detail
-
DynamicLoadEstimator
public DynamicLoadEstimator(DynamicLoadEstimator.SinglePointEstimator singlePointEstimator, java.util.function.Function<Individual,java.lang.String> specificationBuilder, Variable... employedVariables)
Creates a new instance.- Parameters:
singlePointEstimator- theDynamicLoadEstimator.SinglePointEstimatorto usespecificationBuilder- creates a MathEx specification for the new instance with the parameters from anIndividualemployedVariables- theVariables appearing in thesinglePointEstimator
-
DynamicLoadEstimator
public DynamicLoadEstimator(DynamicLoadEstimator.SinglePointEstimator singlePointEstimator, java.util.function.Function<Individual,java.lang.String> specificationBuilder, java.util.Collection<Variable> employedVariables)
Creates a new instance.- Parameters:
singlePointEstimator- theDynamicLoadEstimator.SinglePointEstimatorto useemployedVariables- theVariables appearing in thesinglePointEstimator
-
-
Method Detail
-
createFor
public static DynamicLoadEstimator createFor(java.lang.String templateKey, java.lang.String resource, java.lang.String expression, OptimizationSpace optimizationSpace)
Parses a mathematical expression and provides it as aLoadEstimator.SinglePointEstimationFunction.- Parameters:
templateKey- of theexpressionresource- that is being estimatedexpression- a mathematical expressionoptimizationSpace- in which newVariables should be created- Returns:
- the
LoadEstimator.SinglePointEstimationFunction
-
calculate
public LoadEstimate calculate(EstimationContext context)
Description copied from class:LoadEstimatorCalculate theLoadEstimate.- Specified by:
calculatein classLoadEstimator- Parameters:
context- within that theLoadEstimateshould be calculated- Returns:
- the
LoadEstimate
-
toMathEx
public java.lang.String toMathEx(Individual individual)
Creates a MathEx expression reflecting this instance under the configuration specified by anIndividual.- Parameters:
individual- specifies values of the employedVariables- Returns:
- the MathEx expression
-
-