AlternatingEpEnergyConsumer

Package: inet.power.consumer

AlternatingEpEnergyConsumer

simple module

C++ definition

This energy consumer model alternates between two modes called consumption and sleep mode. In consumption mode, it consumes a randomly selected constant power for a random time interval. In sleep mode, it doesn't consume energy for another random time interval.

<b>See also:</b> ~AlternatingEpEnergyGenerator

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
EpEnergyConsumerBase simple module

This is an abstract base module for power-based energy consumer models. It defines shared signals and statistics.

Parameters

Name Type Default value Description
displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

energySourceModule string "^.energyStorage"

Module path of the energy source

powerConsumption double

The amount of power consumed in consumption mode

consumptionInterval double

The time interval for the consumption mode

sleepInterval double

The time interval for the sleep mode

Properties

Name Value Description
class AlternatingEpEnergyConsumer
display i=block/plug

Signals

Name Type Unit Description
powerConsumptionChanged double

Statistics

Name Title Source Record Unit Interpolation Mode Description
powerConsumption Power consumption powerConsumptionChanged vector W sample-hold

Source code

//
// This energy consumer model alternates between two modes called consumption
// and sleep mode. In consumption mode, it consumes a randomly selected constant
// power for a random time interval. In sleep mode, it doesn't consume energy for
// another random time interval.
//
// @see ~AlternatingEpEnergyGenerator
//
simple AlternatingEpEnergyConsumer extends EpEnergyConsumerBase
{
    parameters:
        string energySourceModule = default("^.energyStorage"); // Module path of the energy source
        volatile double powerConsumption @unit(W); // The amount of power consumed in consumption mode
        volatile double consumptionInterval @unit(s); // The time interval for the consumption mode
        volatile double sleepInterval @unit(s); // The time interval for the sleep mode
        @class(AlternatingEpEnergyConsumer);
}

File: src/inet/power/consumer/AlternatingEpEnergyConsumer.ned