How to count discarded entities in a FIFO queue using Simulink?

1.3k Views Asked by At

I'm trying to model a single queue, single server simulation using Simulink in MATLAB, I've recently installed it and I'm pretty new.

I've created a Time-Based Entity Generator (with an exponential arrival time), a FIFO queue with capacity of 50 entities and a Single Server with an exponential service time as shown in this image:

My model

I wonder how I can count the number of entities that are generated but can't get into the FIFO because it's full (reached 50 entities already) and discard them.

1

There are 1 best solutions below

0
On

This will probably not help you anymore, but I found a solution to this problem and thought I would share it for future reference. The way to solve it is using an Output Switch block with 2 ports. Connect the first to your FIFO queue and the second to a sink (or whatever you want your entities to go to) and select "First port that is not blocked" as a switching criterion. Picture here: https://i.stack.imgur.com/x8f6A.png. Cheers!