PacketBasedTokenGenerator

Package: inet.queueing.tokengenerator

PacketBasedTokenGenerator

simple module

C++ definition

Generates tokens into the configured ~TokenBasedServer for each consumed packet.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Used in compound modules

Name Type Description
TelnetServerConnection compound module

Contains a configurable pre-composed telnet traffic source and traffic sink as part of a telnet server application.

TelnetServerTraffic compound module (no description)

Used in

Name Type Description
PacketBasedTokenGeneratorTutorialStep 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 "processed %p pk (%l)\ngenerated %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

numTokensPerPacket double 1

Number of tokens per consumed packet

numTokensPerBit double 0

Number of tokens per consumed bit

Properties

Name Value Description
class PacketBasedTokenGenerator
display i=block/control

Gates

Name Direction Size Description
in input

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 into the configured ~TokenBasedServer for each
// consumed packet.
//
simple PacketBasedTokenGenerator extends TokenGeneratorBase like ITokenGenerator, IPassivePacketSink
{
    parameters:
        volatile double numTokensPerPacket = default(1); // Number of tokens per consumed packet
        volatile double numTokensPerBit = default(0); // Number of tokens per consumed bit
        displayStringTextFormat = default("processed %p pk (%l)\ngenerated %t tk\nto %s"); // %p number of packets, %l total length
        @class(PacketBasedTokenGenerator);
    gates:
        input in;
}
File: src/inet/queueing/tokengenerator/PacketBasedTokenGenerator.ned