AlternatingEpEnergyGenerator

Package: inet.power.generator

AlternatingEpEnergyGenerator

simple module

This energy generator model alternates between two modes called generation and sleep mode. In generation mode it generates a randomly selected constant power for a random time interval. In sleep mode it doesn't generate energy for another random time interval.

See also: AlternatingEpEnergyConsumer

Inheritance diagram

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

Extends

Name Type Description
EpEnergyGeneratorBase simple module

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

Parameters

Name Type Default value Description
energySinkModule string "^.energyStorage"

module path of energy sink

powerGeneration double

amount of power generated in generation mode

generationInterval double

time interval for generation mode

sleepInterval double

time interval for sleep mode

Properties

Name Value Description
display i=block/plug
class AlternatingEpEnergyGenerator

Signals

Name Type Unit
powerGenerationChanged

Statistics

Name Title Source Record Unit Interpolation Mode
powerGeneration Power generation powerGenerationChanged vector W sample-hold

Scheduled messages (observed)

msgkindctrltagsmsgnamecontext
omnetpp::cMessage0timer

Direct method calls (observed)

call tofunctioninfo
SimpleEpEnergyStorageinet::power::SimpleEpEnergyStorage::addEnergyGeneratoraddEnergyGenerator
SimpleEpEnergyStorageinet::power::SimpleEpEnergyStorage::receiveSignalpowerGenerationChanged

Source code

//
// This energy generator model alternates between two modes called generation
// and sleep mode. In generation mode it generates a randomly selected constant
// power for a random time interval. In sleep mode it doesn't generate energy
// for another random time interval.
//
// @see ~AlternatingEpEnergyConsumer
//
simple AlternatingEpEnergyGenerator extends EpEnergyGeneratorBase
{
    parameters:
        string energySinkModule = default("^.energyStorage"); // module path of energy sink
        volatile double powerGeneration @unit(W); // amount of power generated in generation mode
        volatile double generationInterval @unit(s); // time interval for generation mode
        volatile double sleepInterval @unit(s); // time interval for sleep mode
        @class(AlternatingEpEnergyGenerator);
}

File: src/inet/power/generator/AlternatingEpEnergyGenerator.ned