2

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.

Alex Kulinkovich
  • 4,408
  • 15
  • 46
  • 50
Joaquín L. Robles
  • 6,261
  • 10
  • 66
  • 96
  • 1
    This is a SimEvents model, which is a pretty specialised and niche application of Simulink. I don't think you'll find somebody on SO with expertise or experience in SimEvents, you would be better off trying on MATLAB Answers (http://www.mathworks.co.uk/matlabcentral/answers/) – am304 Jan 30 '14 at 15:53

1 Answers1

1

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!

Imre_G
  • 2,468
  • 1
  • 17
  • 33