Generating Tokens When a Queue Becomes Empty ============================================ The :ned:`QueueBasedTokenGenerator` module generates tokens into a token-based server when an observed queue becomes empty. The module can be used by applications to create traffic that completely utilizes a network interface, for example. In this example network, packets are generated by a passive packet source (:ned:`PassivePacketSource`). A token-based server (:ned:`TokenBasedServer`) pops packets from the source when it has enough tokens. Then it pushes packets into the connected queue (:ned:`PacketQueue`). Packets are collected from the queue by an active packet sink (:ned:`ActivePacketSink`). Tokens are generated by a :ned:`QueueBasedTokenGenerator`, which observes the queue, and generates a token whenever the queue is empty. .. figure:: media/QueueBasedTokenGenerator.png :width: 80% :align: center .. literalinclude:: ../QueueingTutorial.ned :start-at: network QueueBasedTokenGenerator :end-before: //---- :language: ned .. literalinclude:: ../omnetpp.ini :start-at: Config QueueBasedTokenGenerator :end-at: collectionInterval :language: ini