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
AdjustableLoadProfileEstimator
implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DynamicLoadEstimator.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 DynamicLoadEstimator
zeroLoad
Instance 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 LoadEstimate
calculate(EstimationContext context)
Calculate theLoadEstimate
.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
.java.util.Collection<Variable>
getEmployedVariables()
Get theVariable
s used in this instance.java.lang.String
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 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.SinglePointEstimator
to usespecificationBuilder
- creates a MathEx specification for the new instance with the parameters from anIndividual
employedVariables
- theVariable
s 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.SinglePointEstimator
to useemployedVariables
- theVariable
s 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 theexpression
resource
- that is being estimatedexpression
- a mathematical expressionoptimizationSpace
- in which newVariable
s should be created- Returns:
- the
LoadEstimator.SinglePointEstimationFunction
-
calculate
public LoadEstimate calculate(EstimationContext context)
Description copied from class:LoadEstimator
Calculate theLoadEstimate
.- Specified by:
calculate
in classLoadEstimator
- Parameters:
context
- within that theLoadEstimate
should 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 employedVariable
s- Returns:
- the MathEx expression
-
-