Package: inet.queueing.tokengenerator
TimeBasedTokenGenerator
simple moduleThis module generates tokens for a TokenBasedServer repeatedly.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Extends
Name | Type | Description |
---|---|---|
TokenGeneratorBase | simple module |
This is a base module for various token generator modules. |
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 |
|
clockModule | string | "" |
relative path of a module that implements IClock; optional |
generationInterval | double |
time interval between two subsequent token generation events |
|
numTokens | double | 1 |
number of tokens generated repeatedly |
Properties
Name | Value | Description |
---|---|---|
display | i=block/control | |
class | TimeBasedTokenGenerator |
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 |
Scheduled messages (observed)
msg | kind | ctrl | tags | msgname | context |
---|---|---|---|---|---|
ClockEvent | 0 | GenerationTimer |
Direct method calls (observed)
call to | function | info |
---|---|---|
TokenBasedServer | inet::queueing::TokenBasedServer::addTokens | addTokens |
Source code
// // This module generates tokens for a ~TokenBasedServer repeatedly. // simple TimeBasedTokenGenerator extends TokenGeneratorBase { 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