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 IResourcePowerModelCalculator
getCalculator(AbstractPowerConsumingResource resource)
Gets the calculator that is set for a specific resource.AbstractDistributionPowerModelCalculator
getCalculator(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 eachPowerConsumingResource
which metrics are required for the associatedAbstractResourcePowerModelCalculator
to calculate the power consumption valuesvoid
updateDistributionPowerModel(PowerProvidingEntity ppe, AbstractDistributionPowerModelCalculator pduCalculator)
Updates the power model of aPowerProvidingEntity
.void
updateResourcePowerModel(PowerConsumingResourceSet powerConsumingResource, IResourcePowerModelCalculator resourceCalculator)
Updates the power model of a specific resource.void
updateStatefulPowerConsumingResource(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
- TheAbstractDistributionPowerModelCalculator
instance for the power distribution model ofppe
.
-
getCalculator
public IResourcePowerModelCalculator getCalculator(AbstractPowerConsumingResource resource)
Gets the calculator that is set for a specific resource.- Parameters:
resource
- ThePowerConsumingResource
for which the calculator shall be retrieved.- Returns:
- The
AbstractResourcePowerModelCalculator
set for theresource
, ornull
if 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
- ThePowerProvidingEntity
for which the calculator shall be retrieved.- Returns:
- The
AbstractDistributionPowerModelCalculator
set for theentity
, ornull
if none is found. * @throws NullPointerException In caseentity == null
.
-
getRequiredMetricsForRegisteredCalculators
public Map<AbstractPowerConsumingResource,Set<org.palladiosimulator.metricspec.MetricDescription>> getRequiredMetricsForRegisteredCalculators()
Gets a map specifying for eachPowerConsumingResource
which metrics are required for the associatedAbstractResourcePowerModelCalculator
to calculate the power consumption values- Returns:
- an UNMODIFIABLE map linking
PowerConsumingResource
s to multipleMetricDescription
s
-
-