TimeBasedTokenGenerator¶
Package: inet.queueing.tokengenerator
simple module TimeBasedTokenGenerator
Generates tokens for a TokenBasedServer repeatedly.
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
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 |
|
clockModule |
string |
“” |
Relative path of a module that implements IClock(1,:ref:2 <neddoc-msg-inet-iclock>); optional |
generationInterval |
double |
Time interval between two subsequent token generation events |
|
numTokens |
double |
1 |
Number of tokens generated repeatedly |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
TimeBasedTokenGenerator |
|
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 repeatedly.
//
simple TimeBasedTokenGenerator extends TokenGeneratorBase like ITokenGenerator
{
parameters:
string clockModule = default(""); // Relative path of a module that implements IClock; optional
volatile double generationInterval @unit(s); // Time interval between two subsequent token generation events
volatile double numTokens = default(1); // Number of tokens generated repeatedly
@class(TimeBasedTokenGenerator);
@display("i=block/control");
}
File: src/inet/queueing/tokengenerator/TimeBasedTokenGenerator.ned