Package de.fzi.power.interpreter
Class PowerModelRegistry
- java.lang.Object
-
- org.palladiosimulator.commons.designpatterns.AbstractObservable<PowerModelRegistryChangeListener>
-
- de.fzi.power.interpreter.PowerModelRegistry
-
- All Implemented Interfaces:
org.palladiosimulator.commons.designpatterns.IAbstractObservable<PowerModelRegistryChangeListener>
public class PowerModelRegistry extends org.palladiosimulator.commons.designpatterns.AbstractObservable<PowerModelRegistryChangeListener>
Registry through which the power models of the resources and distribution units are managed.
-
-
Constructor Summary
Constructors Constructor Description PowerModelRegistry()Create a power model registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IResourcePowerModelCalculatorgetCalculator(AbstractPowerConsumingResource resource)Gets the calculator that is set for a specific resource.AbstractDistributionPowerModelCalculatorgetCalculator(PowerProvidingEntity entity)Gets the calculator that is set for a specific power providing entity.Map<AbstractPowerConsumingResource,Set<org.palladiosimulator.metricspec.MetricDescription>>getRequiredMetricsForRegisteredCalculators()Gets a map specifying for eachPowerConsumingResourcewhich metrics are required for the associatedAbstractResourcePowerModelCalculatorto calculate the power consumption valuesvoidupdateDistributionPowerModel(PowerProvidingEntity ppe, AbstractDistributionPowerModelCalculator pduCalculator)Updates the power model of aPowerProvidingEntity.voidupdateResourcePowerModel(PowerConsumingResourceSet powerConsumingResource, IResourcePowerModelCalculator resourceCalculator)Updates the power model of a specific resource.voidupdateStatefulPowerConsumingResource(StatefulPowerConsumingResourceSet powerConsumingResource, IResourcePowerModelCalculator resourceCalculator)
-
-
-
Method Detail
-
updateResourcePowerModel
public void updateResourcePowerModel(PowerConsumingResourceSet powerConsumingResource, IResourcePowerModelCalculator resourceCalculator)
Updates the power model of a specific resource.- Parameters:
powerConsumingResource- The resource for which the power model specification is updated.resourceCalculator- The calculator used to evaluate the power consumption of a resource.
-
updateStatefulPowerConsumingResource
public void updateStatefulPowerConsumingResource(StatefulPowerConsumingResourceSet powerConsumingResource, IResourcePowerModelCalculator resourceCalculator)
-
updateDistributionPowerModel
public void updateDistributionPowerModel(PowerProvidingEntity ppe, AbstractDistributionPowerModelCalculator pduCalculator)
Updates the power model of aPowerProvidingEntity.- Parameters:
ppe- the entity for which the power model is set.pduCalculator- TheAbstractDistributionPowerModelCalculatorinstance for the power distribution model ofppe.
-
getCalculator
public IResourcePowerModelCalculator getCalculator(AbstractPowerConsumingResource resource)
Gets the calculator that is set for a specific resource.- Parameters:
resource- ThePowerConsumingResourcefor which the calculator shall be retrieved.- Returns:
- The
AbstractResourcePowerModelCalculatorset for theresource, ornullif none is found. - Throws:
NullPointerException- In caseresource == null.
-
getCalculator
public AbstractDistributionPowerModelCalculator getCalculator(PowerProvidingEntity entity)
Gets the calculator that is set for a specific power providing entity.- Parameters:
entity- ThePowerProvidingEntityfor which the calculator shall be retrieved.- Returns:
- The
AbstractDistributionPowerModelCalculatorset for theentity, ornullif none is found. * @throws NullPointerException In caseentity == null.
-
getRequiredMetricsForRegisteredCalculators
public Map<AbstractPowerConsumingResource,Set<org.palladiosimulator.metricspec.MetricDescription>> getRequiredMetricsForRegisteredCalculators()
Gets a map specifying for eachPowerConsumingResourcewhich metrics are required for the associatedAbstractResourcePowerModelCalculatorto calculate the power consumption values- Returns:
- an UNMODIFIABLE map linking
PowerConsumingResources to multipleMetricDescriptions
-
-