TimeBasedTokenGenerator
Package: inet.queueing.tokengenerator
TimeBasedTokenGenerator
simple moduleGenerates tokens for a ~TokenBasedServer repeatedly.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Used in
| Name | Type | Description |
|---|---|---|
| TimeBasedTokenGeneratorTutorialStep | network | (no description) |
| TokenBucketTutorialStep | network | (no description) |
Extends
| Name | Type | Description |
|---|---|---|
| TokenGeneratorBase | simple module |
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, 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,2); 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 |
|---|---|---|---|---|---|---|
| tokensCreated | tokens created | count(tokensCreated) | count | tk |
the statistical value is the number of times tokens were created |
|
| numTokensCreated | number of created tokens | tokensCreated | sum, vector | tk | none |
the statistical value is the number of created tokens |
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