Class CustomExpressionContext
- java.lang.Object
-
- org.vedantatree.expressionoasis.ExpressionContext
-
- de.fzi.power.interpreter.calculator.expressionoasis.custom.CustomExpressionContext
-
public class CustomExpressionContext extends ExpressionContext
This class is an extension of theExpressionContext
class, tailored to deal withExpressions
that containFixedFactor
s andConsumptionFactor
s. It is used by theExpressionOasisDistributionPowerModelCalculator
and theExpressionOasisResourcePowerModelCalculator
to handleDeclarativePowerModelSpecification
s.
The peculiarity of a measured factor is that while it is denoted by a variable within an expression, it might be composed of several values at simulation-time. For example, a measured factoroutletConsumption
may refer to allPowerConsumingResource
s that are supplied by aPowerDistributionUnit
. Thus, variables that represent measured factors are polymorphic in some way, but it cannot be determined beforehand whether they are composite variables or not.
Moreover, this class also serves as a facade to all other non-public classes in this package.
-
-
Constructor Summary
Constructors Constructor Description CustomExpressionContext(EList<AbstractFixedFactorValue<?>> eList, Iterable<ConsumptionFactor> consumptionFactors)
Initializes a new instance of theCustomExpressionContext
class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBasicMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measuringValue)
void
addPowerConsumptions(Iterable<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>> outletConsumptions)
void
clearMeasurements()
Collection<org.palladiosimulator.metricspec.MetricDescription>
getMeasuredFactors()
boolean
isMeasuredFactorAvailable(String measuredFactorName)
boolean
isMeasuredFactorAvailable(org.palladiosimulator.metricspec.MetricDescription measuredFactorMetricDescription)
double
toDouble(ValueObject valueObject)
-
Methods inherited from class org.vedantatree.expressionoasis.ExpressionContext
addFunctionProvider, addVariableProvider, addVariableProvider, clearVariableProviders, getContextProperty, getFunctionProviders, getVariableProvider, getVariableProviders, reset, setContextProperty
-
-
-
-
Constructor Detail
-
CustomExpressionContext
public CustomExpressionContext(EList<AbstractFixedFactorValue<?>> eList, Iterable<ConsumptionFactor> consumptionFactors) throws ExpressionEngineException
Initializes a new instance of theCustomExpressionContext
class.- Parameters:
eList
- AnIterable
ofFixedFactorValue
s to be managed by this instance.consumptionFactors
- AnIterable
ofConsumptionFactor
s to be managed by this instance.- Throws:
ExpressionEngineException
- In case something goes wrong in the super-constructor.
-
-
Method Detail
-
addBasicMeasurement
public void addBasicMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measuringValue)
-
addPowerConsumptions
public void addPowerConsumptions(Iterable<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>> outletConsumptions)
-
clearMeasurements
public void clearMeasurements()
-
getMeasuredFactors
public Collection<org.palladiosimulator.metricspec.MetricDescription> getMeasuredFactors()
-
isMeasuredFactorAvailable
public boolean isMeasuredFactorAvailable(String measuredFactorName)
-
isMeasuredFactorAvailable
public boolean isMeasuredFactorAvailable(org.palladiosimulator.metricspec.MetricDescription measuredFactorMetricDescription)
-
toDouble
public double toDouble(ValueObject valueObject)
-
-