Class PowerConsumptionSwitch


  • public final class PowerConsumptionSwitch
    extends InfrastructureSwitch<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>>
    This class is used as the basis of interpreters that evaluate the power consumption of Infrastructure models. It is interpreted for the current point in time associated with the ConsumptionContext that is set for this.
    • Method Detail

      • createPowerConsumptionSwitch

        public static PowerConsumptionSwitch createPowerConsumptionSwitch​(ConsumptionContext ctx)
        Creates a power consumption switch. It is used to evaluate the power consumption for a given evaluation scope. Changes to the properties of ctx are considered in the evaluation of the power consumption.
        Parameters:
        ctx - A ConsumptionContext instance denoting the initial evaluation context.
        Returns:
        The PowerConsumptionSwitch to be used for the evaluation.
        Throws:
        IllegalArgumentException - In case the given consumption context was null.
      • casePowerDistributionUnit

        public org.jscience.physics.amount.Amount<javax.measure.quantity.Power> casePowerDistributionUnit​(PowerDistributionUnit pdu)
        Evaluate the power consumption of all elements connected to pdu
        Overrides:
        casePowerDistributionUnit in class InfrastructureSwitch<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>>
        Parameters:
        pdu - The power distribution unit for which the power consumption evaluation is performed
        Returns:
        The power consumption evaluation result.
        See Also:
        doSwitch(EObject)
      • casePowerConsumingProvidingEntity

        public org.jscience.physics.amount.Amount<javax.measure.quantity.Power> casePowerConsumingProvidingEntity​(PowerConsumingProvidingEntity providingConsumingEntity)
        Evaluates the power consumption of all elements connected to a PowerConsumingProvidingEntity.
        Overrides:
        casePowerConsumingProvidingEntity in class InfrastructureSwitch<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>>
        Parameters:
        providingConsumingEntity - The entity for which the consumption is evaluated.
        Returns:
        The power consumption evaluation result.
        See Also:
        doSwitch(EObject)
      • casePowerProvidingEntity

        public org.jscience.physics.amount.Amount<javax.measure.quantity.Power> casePowerProvidingEntity​(PowerProvidingEntity ppEntity)
        Evaluates the power consumption of all elements connected to a PowerProvidingEntity. Uses {@see PowerConsumptionSwitch#doSwitch(int, org.eclipse.emf.ecore.EObject)} to evaluate the consumption using the case of this switch that is the actual type of ppEntity.
        Overrides:
        casePowerProvidingEntity in class InfrastructureSwitch<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>>
        Parameters:
        ppEntity - The entity for which the consumption of connected elements is evaluated.
        Returns:
        The power consumption evaluation result.
        See Also:
        doSwitch(EObject)
      • casePowerConsumingEntity

        public org.jscience.physics.amount.Amount<javax.measure.quantity.Power> casePowerConsumingEntity​(PowerConsumingEntity powerConsumingEntity)
        Evaluates the power consumption of a PowerConsumingEntity. Uses {@see PowerConsumptionSwitch#doSwitch(int, org.eclipse.emf.ecore.EObject)} to evaluate the consumption using the case of this switch that is the actual type of object.
        Overrides:
        casePowerConsumingEntity in class InfrastructureSwitch<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>>
        Parameters:
        powerConsumingEntity - The entity for which the power consumption is evaluated.
        Returns:
        the result of interpreting the object as an instance of 'Power Consuming Entity'.
        See Also:
        doSwitch(EObject)
      • caseMountedPowerDistributionUnit

        public org.jscience.physics.amount.Amount<javax.measure.quantity.Power> caseMountedPowerDistributionUnit​(MountedPowerDistributionUnit mountedPdu)
        Evaluates the power consumption of a mounted PDU and the elements nested below it.
        Overrides:
        caseMountedPowerDistributionUnit in class InfrastructureSwitch<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>>
        Parameters:
        mountedPdu - The power distribution unit for which the power consumption is evaluated.
        Returns:
        The evaluated power consumption.
        See Also:
        doSwitch(EObject)
      • casePowerConsumingResourceSet

        public org.jscience.physics.amount.Amount<javax.measure.quantity.Power> casePowerConsumingResourceSet​(PowerConsumingResourceSet resource)
        Evaluate the power consumption of a PowerConsumingResource. The evaluation is performed by looking up the power consumption specification/power model set for the resource.
        Overrides:
        casePowerConsumingResourceSet in class InfrastructureSwitch<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>>
        Parameters:
        resource - The power consuming resource.
        Returns:
        The amount of power consumed by the resource.
        See Also:
        doSwitch(EObject)
      • caseStatefulPowerConsumingResourceSet

        public org.jscience.physics.amount.Amount<javax.measure.quantity.Power> caseStatefulPowerConsumingResourceSet​(StatefulPowerConsumingResourceSet resource)
        Description copied from class: InfrastructureSwitch
        Returns the result of interpreting the object as an instance of 'Stateful Power Consuming Resource Set'. This implementation returns null; returning a non-null result will terminate the switch.
        Overrides:
        caseStatefulPowerConsumingResourceSet in class InfrastructureSwitch<org.jscience.physics.amount.Amount<javax.measure.quantity.Power>>
        Parameters:
        resource - the target of the switch.
        Returns:
        the result of interpreting the object as an instance of 'Stateful Power Consuming Resource Set'.
        See Also:
        doSwitch(EObject)