how to determine whether a queue is empty in Simevents and do some actions based on this observation?

345 views Asked by At

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

There are 1 answers

0
gatorback On

The "number of entities in the Queue" can be found in the 'Statistics' tab of the Queue's properties.

enter image description here

Enabling it (clicking it's checkbox) will enable the signal of interest on the block (#n) that can be connected to other Simulink blocks.

enter image description here

Connect the #n signal to "compare to constant" block to create a boolean signal that indicates if the queue is / is not empty.

enter image description here