PacketBasedTokenGeneratorTutorialStep

Package: inet.tutorials.queueing

PacketBasedTokenGeneratorTutorialStep

network

(no description)

producer : ActivePacketSource

An active packet source which pushes packets into the connected module.

Source:
producer: ActivePacketSource {
    @display("p=100,125");
} provider : PassivePacketSource

A passive packet source which can be pulled for packets from the connected packet collector.

Source:
provider: PassivePacketSource {
    @display("p=500,125");
} server : TokenBasedServer

Repeatedly pulls packets from the connected packet provider and it pushes them into the connected...

Source:
server: TokenBasedServer {
    @display("p=700,125");
} consumer : PassivePacketSink

A passive packet sink which is pushed with packets by the connected packet producer.

Source:
consumer: PassivePacketSink {
    @display("p=900,125");
} tokenGenerator : PacketBasedTokenGenerator

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

Source:
tokenGenerator: PacketBasedTokenGenerator {
    @display("p=300,125");
    storageModule = "^.server";
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Properties

Name Value Description
isNetwork
display bgb=1000,250

Unassigned submodule parameters

Name Type Default value Description
producer.displayStringTextFormat string "created %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

producer.packetNameFormat string "%a-%c"

See directives in module documentation

producer.packetRepresentation string "byteCount"

Determines the chunk of the packet data

producer.packetProtocol string "unknown"
producer.packetLength int
producer.packetData int -1
producer.attachCreationTimeTag bool true
producer.attachIdentityTag bool true
producer.attachDirectionTag bool true
producer.clockModule string ""

Relative path of a module that implements IClock(1,2); optional

producer.initialProductionOffset double -1s

Initial duration before which packets are not produced. When negative, then produce packet in initialize()

producer.productionInterval double

Elapsed time between subsequent packets pushed to the connected packet consumer

producer.scheduleForAbsoluteTime bool true

When a clock is used, "relative" means that setting the clock will not affect the simulation time of the event

provider.displayStringTextFormat string "created %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

provider.packetNameFormat string "%a-%c"

See directives in module documentation

provider.packetRepresentation string "byteCount"

Determines the chunk of the packet data

provider.packetProtocol string "unknown"
provider.packetLength int
provider.packetData int -1
provider.attachCreationTimeTag bool true
provider.attachIdentityTag bool true
provider.attachDirectionTag bool true
provider.clockModule string ""

Relative path of a module that implements IClock(1,2); optional

provider.initialProvidingOffset double 0s

Initial duration before which packets are not provided

provider.providingInterval double 0s

Elapsed time between subsequent packets allowed to be pulled by the connected packet collector, 0 means any number of packets can be pulled at the same simulation time

provider.scheduleForAbsoluteTime bool true

When a clock is used, relative means that setting the clock will not affect the simulation time of the event

server.displayStringTextFormat string "contains %n tk\nserved %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

server.initialNumTokens double 0

Initial number of tokens

server.maxNumTokens double nan

Maximum number of tokens

server.tokenConsumptionPerPacket double 1

How many tokens are consumed per processed packet

server.tokenConsumptionPerBit double 0

How many tokens are consumed per processed bit

consumer.displayStringTextFormat string "received %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

consumer.clockModule string ""

Relative path of a module that implements IClock(1,2); optional

consumer.initialConsumptionOffset double 0s

Initial duration before which packets are not consumed

consumer.consumptionInterval double 0s

Elapsed time between subsequent packets allowed to be pushed by the connected packet producer, 0 means any number of packets can be pushed at the same simulation time

consumer.scheduleForAbsoluteTime bool true

When a clock is used, "relative" means that setting the clock will not affect the simulation time of the event

tokenGenerator.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

tokenGenerator.numTokensPerPacket double 1

Number of tokens per consumed packet

tokenGenerator.numTokensPerBit double 0

Number of tokens per consumed bit

Source code

network PacketBasedTokenGeneratorTutorialStep
{
    @display("bgb=1000,250");
    submodules:
        producer: ActivePacketSource {
            @display("p=100,125");
        }
        provider: PassivePacketSource {
            @display("p=500,125");
        }
        server: TokenBasedServer {
            @display("p=700,125");
        }
        consumer: PassivePacketSink {
            @display("p=900,125");
        }
        tokenGenerator: PacketBasedTokenGenerator {
            @display("p=300,125");
            storageModule = "^.server";
        }
    connections allowunconnected:
        producer.out --> tokenGenerator.in;
        provider.out --> server.in;
        server.out --> consumer.in;
}

//-------------------------------------------------

File: tutorials/queueing/QueueingTutorial.ned