ResponseProducer

Package: inet.queueing.source

compound module ResponseProducer

Generates several different streams of packets, one after the other. For each traffic category, the packets are produced by a separate token-based server. The traffic stream can be started by adding tokens to the corresponding server module. The packet data, packet length, and timing distributions can be configured in the corresponding packet provider.

See also: RequestConsumer

Usage diagram

Inheritance diagram

Parameters

Name

Type

Default value

Description

numKind

int

requestConsumerModule

string

“^.sink”

Properties

Name

Value

Description

display

i=block/source

Gates

Name

Direction

Size

Description

out

output

Unassigned submodule parameters

Name

Type

Default value

Description

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,:ref:2 <neddoc-msg-inet-iclock>); 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 {numTokens} tk\nserved {numProcessedPackets} pk ({processedTotalLength})”

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

multiplexer.displayStringTextFormat

string

“passed %p pk (%l)”

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

multiplexer.forwardServiceRegistration

bool

true

multiplexer.forwardProtocolRegistration

bool

true

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

tokenGenerator.storageModule

string

“^.” + parent.requestConsumerModule + “.server”

Module path of the token storage where the tokens are generated via C++ method call

tokenGenerator.subscriptionModule

string

“^”

tokenGenerator.signals

string

“tokensDepleted”

tokenGenerator.intSignalValue

int

-1

tokenGenerator.doubleSignalValue

double

nan

tokenGenerator.numTokens

double

1

Number of tokens generated repeatedly

Source code

//
// Generates several different streams of packets, one after the other.
// For each traffic category, the packets are produced by
// a separate token-based server. The traffic stream can be started by adding
// tokens to the corresponding server module. The packet data, packet length, and
// timing distributions can be configured in the corresponding packet provider.
//
// @see ~RequestConsumer
//
module ResponseProducer like IActivePacketSource
{
    parameters:
        int numKind;
        string requestConsumerModule = default("^.sink");
        @display("i=block/source");
    gates:
        output out;
    submodules:
        provider[numKind]: PassivePacketSource {
            @display("p=300,100,row,200");
        }
        server[numKind]: TokenBasedServer {
            @display("p=300,225,row,200");
        }
        multiplexer: PacketMultiplexer {
            @display("p=300,350");
        }
        tokenGenerator: SignalBasedTokenGenerator {
            storageModule = default("^." + parent.requestConsumerModule + ".server");
            signals = default("tokensDepleted");
            @display("p=100,100");
        }
    connections:
        for i=0..sizeof(provider) - 1 {
            provider[i].out --> server[i].in;
            server[i].out --> multiplexer.in++;
        }
        multiplexer.out --> { @display("m=s"); } --> out;
}

File: src/inet/queueing/source/ResponseProducer.ned