how to determine whether a queue is empty in Simevents and do some actions based on this observation?
Mostra commenti meno recenti
Hi guys,
I want to model a queue with vacations. When the queue is empty, the server will have a period of vacation with certain distribution.(I can use use gate to block the server ) So I need to get the data of the number of entity in queue block. Could you please tell me how to do that?
Many thanks.
1 Commento
Tianhao Guo
il 23 Apr 2016
Modificato: Tianhao Guo
il 23 Apr 2016
Risposte (1)
Nikhil Vyas
il 27 Apr 2016
1 voto
The Queue blocks(and almost all the other similar blocks of simevents) has a Statistics Tab in the Block Parameters.

This would result in an additional port #n appearing on the block. You can monitor this port to check the number of entities in the queue at any time. If #n gives you 0, the queue is currently empty.
1 Commento
Tianhao Guo
il 27 Apr 2016
Categorie
Scopri di più su Messages in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!