Package org.apache.wayang.profiler.log
Class DynamicLoadEstimator
java.lang.Object
org.apache.wayang.core.optimizer.costs.LoadEstimator
org.apache.wayang.profiler.log.DynamicLoadEstimator
Adjustable
LoadProfileEstimator implementation.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.wayang.core.optimizer.costs.LoadEstimator
LoadEstimator.SinglePointEstimationFunction -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic DynamicLoadEstimatorInstance that always estimates a load of0.Fields inherited from class org.apache.wayang.core.optimizer.costs.LoadEstimator
nullCardinalityReplacement, UNSPECIFIED_NUM_SLOTS -
Constructor Summary
ConstructorsConstructorDescriptionDynamicLoadEstimator(DynamicLoadEstimator.SinglePointEstimator singlePointEstimator, Function<Individual, String> specificationBuilder, Collection<Variable> employedVariables) Creates a new instance.DynamicLoadEstimator(DynamicLoadEstimator.SinglePointEstimator singlePointEstimator, Function<Individual, String> specificationBuilder, Variable... employedVariables) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncalculate(EstimationContext context) Calculate theLoadEstimate.static DynamicLoadEstimatorcreateFor(String templateKey, String resource, String expression, OptimizationSpace optimizationSpace) Parses a mathematical expression and provides it as aLoadEstimator.SinglePointEstimationFunction.Get theVariables used in this instance.toMathEx(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 Details
-
zeroLoad
Instance that always estimates a load of0.
-
-
Constructor Details
-
DynamicLoadEstimator
public DynamicLoadEstimator(DynamicLoadEstimator.SinglePointEstimator singlePointEstimator, Function<Individual, 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, Function<Individual, String> specificationBuilder, Collection<Variable> employedVariables) Creates a new instance.- Parameters:
singlePointEstimator- theDynamicLoadEstimator.SinglePointEstimatorto useemployedVariables- theVariables appearing in thesinglePointEstimator
-
-
Method Details
-
createFor
public static DynamicLoadEstimator createFor(String templateKey, String resource, 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
Description copied from class:LoadEstimatorCalculate theLoadEstimate.- Specified by:
calculatein classLoadEstimator- Parameters:
context- within that theLoadEstimateshould be calculated- Returns:
- the
LoadEstimate
-
toMathEx
Creates a MathEx expression reflecting this instance under the configuration specified by anIndividual.- Parameters:
individual- specifies values of the employedVariables- Returns:
- the MathEx expression
-
getEmployedVariables
Get theVariables used in this instance.- Returns:
- the
Variables
-