TokenGeneratorBase

Package: inet.queueing.base

TokenGeneratorBase

simple module

C++ definition

Base module for various token generator modules.

Inheritance diagram

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

Known subclasses

Name Type Description
PacketBasedTokenGenerator simple module

Generates tokens into the configured ~TokenBasedServer for each consumed packet.

QueueBasedTokenGenerator simple module

Generates tokens for a ~TokenBasedServer based on the observed state changes of a packet queue. Its primary purpose is to allow applications to produce traffic which completely utilizes a network interface. This is achieved by generating tokens whenever the observed packet queue becomes empty.

SignalBasedTokenGenerator simple module

Generates tokens for a ~TokenBasedServer based on received signals.

TimeBasedTokenGenerator simple module

Generates tokens for a ~TokenBasedServer repeatedly.

Extends

Name Type Description
PacketProcessorBase simple module

Base module for various packet processing modules which maintains a few statistics.

Parameters

Name Type Default value Description
displayStringTextFormat string "generated %t tk\nto %s"

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

storageModule string

Module path of the token storage where the tokens are generated via C++ method call

Properties

Name Value Description
class TokenGeneratorBase
display i=block/control

Signals

Name Type Unit Description
tokensCreated double

Statistics

Name Title Source Record Unit Interpolation Mode Description
tokensCreated tokens created count(tokensCreated) count tk

the statistical value is the number of times tokens were created

numTokensCreated number of created tokens tokensCreated sum, vector tk none

the statistical value is the number of created tokens

Source code

//
// Base module for various token generator modules.
//
simple TokenGeneratorBase extends PacketProcessorBase
{
    parameters:
        string storageModule; // Module path of the token storage where the tokens are generated via C++ method call
        displayStringTextFormat = default("generated %t tk\nto %s"); // Determines display string text above the submodule
        @class(TokenGeneratorBase);
        @display("i=block/control");
        @signal[tokensCreated](type=double);
        // the statistical value is the number of times tokens were created
        @statistic[tokensCreated](title="tokens created"; source=count(tokensCreated); record=count; unit=tk);
        // the statistical value is the number of created tokens
        @statistic[numTokensCreated](title="number of created tokens"; source=tokensCreated; record=sum,vector; unit=tk; interpolationmode=none);
}
File: src/inet/queueing/base/TokenGeneratorBase.ned