SignalBasedTokenGenerator

Package: inet.queueing.tokengenerator

simple module SignalBasedTokenGenerator

Generates tokens for a TokenBasedServer based on received signals.

inet.queueing.tokengenerator.SignalBasedTokenGeneratorSignalBasedTokenGeneratorsimple

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

ResponseProducer

compound module

Generates several different streams of packets, one after the other. For each traffic category, the packets are produced by a separate token-based server. The traffic stream can be started by adding tokens to the corresponding server module. The packet data, packet length, and timing distributions can be configured in the corresponding packet provider.

Extends

Name

Type

Description

TokenGeneratorBase

simple module

Base module for various token generator modules.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“generated {numTokensGenerated} tk\nto {storageModule}”

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

subscriptionModule

string

“^”

signals

string

intSignalValue

int

-1

doubleSignalValue

double

nan

numTokens

double

1

Number of tokens generated repeatedly

Properties

Name

Value

Description

class

SignalBasedTokenGenerator

display

i=block/control

Signals

Name

Type

Unit

Description

tokensCreated

double

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

numTokensCreated

number of created tokens

tokensCreated

sum,vector

tk

none

the statistical value is the number of created tokens

tokensCreated

tokens created

count(tokensCreated)

count

tk

the statistical value is the number of times tokens were created

Source code

//
// Generates tokens for a ~TokenBasedServer based on received signals.
//
simple SignalBasedTokenGenerator extends TokenGeneratorBase like ITokenGenerator
{
    parameters:
        string subscriptionModule = default("^");
        string signals;
        int intSignalValue = default(-1);
        double doubleSignalValue = default(nan);
        volatile double numTokens = default(1); // Number of tokens generated repeatedly
        @class(SignalBasedTokenGenerator);
        @display("i=block/control");
}

File: src/inet/queueing/tokengenerator/SignalBasedTokenGenerator.ned