AlternatingEpEnergyConsumer

Package: inet.power.consumer

AlternatingEpEnergyConsumer

simple module

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 also: 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
energySourceModule string "^.energyStorage"

module path of energy source

powerConsumption double

amount of power consumed in consumption mode

consumptionInterval double

time interval for consumption mode

sleepInterval double

time interval for sleep mode

Properties

Name Value Description
display i=block/plug
class AlternatingEpEnergyConsumer

Signals

Name Type Unit
powerConsumptionChanged double

Statistics

Name Title Source Record Unit Interpolation Mode
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 energy source
        volatile double powerConsumption @unit(W); // amount of power consumed in consumption mode
        volatile double consumptionInterval @unit(s); // time interval for consumption mode
        volatile double sleepInterval @unit(s); // time interval for sleep mode
        @class(AlternatingEpEnergyConsumer);
}

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