PriorityQueueTutorialStep

Package: inet.tutorials.queueing

PriorityQueueTutorialStep

network

(no description)

producer : ActivePacketSource

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

Source:
producer: ActivePacketSource {
    @display("p=100,100");
} queue : PriorityQueue

Implements a priority queue with multiple inner queues and an optional shared memory buffer.

Source:
queue: PriorityQueue {
    @display("p=300,100");
} collector : ActivePacketSink

An active packet sink which pulls packets from the connected module.

Source:
collector: ActivePacketSink {
    @display("p=500,100");
}

Usage diagram

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

Properties

Name Value Description
isNetwork
display bgb=600,200

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

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

collector.clockModule string ""

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

collector.initialCollectionOffset double -1s

Initial duration before which packets are not collected, negative value means: try the first collection in initialize()

collector.collectionInterval double

Elapsed time between subsequent packets pulled from the connected packet provider

collector.scheduleForAbsoluteTime bool true

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

Source code

network PriorityQueueTutorialStep
{
    @display("bgb=600,200");
    submodules:
        producer: ActivePacketSource {
            @display("p=100,100");
        }
        queue: PriorityQueue {
            @display("p=300,100");
        }
        collector: ActivePacketSink {
            @display("p=500,100");
        }
    connections allowunconnected:
        producer.out --> queue.in;
        queue.out --> collector.in;
}

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

File: tutorials/queueing/QueueingTutorial.ned