TokenGeneratorBase

Package: inet.queueing.base

TokenGeneratorBase

simple module

This is a 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

This module generates tokens into the configured TokenBasedServer for each consumed packet.

QueueBasedTokenGenerator simple module

This module generates tokens for a TokenBasedServer based on the observed state changes of a packet queue. It's 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

This module generates tokens for a TokenBasedServer based on received signals.

TimeBasedTokenGenerator simple module

This module generates tokens for a TokenBasedServer repeatedly.

Extends

Name Type Description
PacketProcessorBase simple module

This is a 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

storageModule string

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

Properties

Name Value Description
display i=block/control
class TokenGeneratorBase

Signals

Name Type Unit
tokensCreated double

Statistics

Name Title Source Record Unit Interpolation Mode
tokensCreated tokens created count(tokensCreated) count tk
numTokensCreated number of created tokens tokensCreated sum, vector tk none

Source code

//
// This is a 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