TokenGeneratorBase¶
Package: inet.queueing.base
simple module TokenGeneratorBase
Base module for various token generator modules.
Inheritance diagram¶
Known subclasses¶
Name |
Type |
Description |
|---|---|---|
simple module |
Generates tokens into the configured TokenBasedServer for each consumed packet. |
|
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. |
|
simple module |
Generates tokens for a TokenBasedServer based on received signals. |
|
simple module |
Generates tokens for a TokenBasedServer repeatedly. |
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for various packet processing modules which maintains a few statistics. |
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 |
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 |
|---|---|---|---|---|---|---|
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¶
//
// 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 {numTokensGenerated} tk\nto {storageModule}"); // 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);
}