Class ExtensibleCalculatorInstantiatorImpl
- java.lang.Object
-
- de.fzi.power.interpreter.calculators.ExtensibleCalculatorInstantiatorImpl
-
- All Implemented Interfaces:
CalculatorInstantiator
public class ExtensibleCalculatorInstantiatorImpl extends Object implements CalculatorInstantiator
Implements a central hub for creating power consumption calculators based on a set of registered PowerFactory instances.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CALCULATOR_FACTORY_EXTENSION_POINT
protected PriorityQueue<CalculatorFactory>
factoryQueue
-
Constructor Summary
Constructors Constructor Description ExtensibleCalculatorInstantiatorImpl()
Instantiates the Calculator Factory.ExtensibleCalculatorInstantiatorImpl(ITimeProvider provider)
Instantiates the extensible Calculator Factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractDistributionPowerModelCalculator
instantiatePowerProvidingEntityCalculator(PowerProvidingEntity ppe)
Creates aAbstractDistributionPowerModelCalculator
for aPowerProvidingEntity
.protected IResourcePowerModelCalculator
instantiateResourceCalculator(ResourcePowerBinding binding)
IResourcePowerModelCalculator
instantiateResourceCalculator(PowerConsumingResourceSet resource)
Creates aAbstractResourcePowerModelCalculator
for aPowerConsumingResource
.IResourcePowerModelCalculator
instantiateStatefulResourcePowerModelCalculator(StatefulPowerConsumingResourceSet resource)
Instantiate the resource power model calculator of a stateful resource.
-
-
-
Field Detail
-
CALCULATOR_FACTORY_EXTENSION_POINT
public static final String CALCULATOR_FACTORY_EXTENSION_POINT
- See Also:
- Constant Field Values
-
factoryQueue
protected final PriorityQueue<CalculatorFactory> factoryQueue
-
-
Constructor Detail
-
ExtensibleCalculatorInstantiatorImpl
public ExtensibleCalculatorInstantiatorImpl()
Instantiates the Calculator Factory. The Calculator Factory uses all registered factories to create Power Model Calculators. It callsExtensibleCalculatorInstantiatorImpl(ITimeProvider)
using a placeholderITimeProvider
that always defaults to 0.
-
ExtensibleCalculatorInstantiatorImpl
public ExtensibleCalculatorInstantiatorImpl(ITimeProvider provider)
Instantiates the extensible Calculator Factory. The Calculator Factory uses all registered factories to create Power Model Calculators. This allows for an extension of supported Calculators in external plugins.- Parameters:
provider
- The time provider used for time-dependent Power Consumption Calculators likeTransitionStatePowerModelCalculator
.
-
-
Method Detail
-
instantiateResourceCalculator
public IResourcePowerModelCalculator instantiateResourceCalculator(PowerConsumingResourceSet resource)
Description copied from interface:CalculatorInstantiator
Creates aAbstractResourcePowerModelCalculator
for aPowerConsumingResource
. The calculator type is selected based on thePowerConsumingResource#getResourcePowerAssemblyContext()
of thePowerConsumingResource
.- Specified by:
instantiateResourceCalculator
in interfaceCalculatorInstantiator
- Parameters:
resource
- The resource for which the calculator is created.- Returns:
- The created calculator.
-
instantiateResourceCalculator
protected IResourcePowerModelCalculator instantiateResourceCalculator(ResourcePowerBinding binding)
-
instantiatePowerProvidingEntityCalculator
public AbstractDistributionPowerModelCalculator instantiatePowerProvidingEntityCalculator(PowerProvidingEntity ppe)
Description copied from interface:CalculatorInstantiator
Creates aAbstractDistributionPowerModelCalculator
for aPowerProvidingEntity
. The calculator type is selected based on thePowerProvidingEntity.getDistributionPowerAssemblyContext()
.- Specified by:
instantiatePowerProvidingEntityCalculator
in interfaceCalculatorInstantiator
- Parameters:
ppe
- The entity for which the calculator is created.- Returns:
- The created distribution power model calculator.
-
instantiateStatefulResourcePowerModelCalculator
public IResourcePowerModelCalculator instantiateStatefulResourcePowerModelCalculator(StatefulPowerConsumingResourceSet resource)
Description copied from interface:CalculatorInstantiator
Instantiate the resource power model calculator of a stateful resource.- Specified by:
instantiateStatefulResourcePowerModelCalculator
in interfaceCalculatorInstantiator
- Parameters:
resource
- the resource for which the power model is generated.- Returns:
- the abstract resource power model calculator
-
-