How to get the distribution of all the times in a queue? [closed]

Edit: The solution was that the serviceRate was too high for the amount of arriving trucks.

In my Anylogic model, I have a population of terminals (5) and a population of trucks (100). The trucks visit the terminals, which are a queueing model for them. The terminals have a number of gates (e.g., 7) that can all service 1 truck at a time (service time is based on a uniform distribution). If all the gates are busy, the other trucks have to wait in a (FIFO) queue in front of the terminal.

I want to measure the time trucks are standing within the queues before the terminals (without the service time). How can I create these terminal processes best within my Anylogic model?

I tried using a service block (the first processes in the picture), but I think that gives all the time and not only the time within the queue. I also tried a queue and delay block (below), to be able to measure the queue time. However, the distribution of the time measurement is not working as I get no distribution but just 1 (very small) number, as can be seen in the lowest picture. Same if I measure the time within the service or delay block... Does any body know how to let this work? Thanks!

enter image description here

enter image description here


You delay capacity is numberOfGates. It means if that value is 5, then 5 trucks will move into delay block at the same time. Other arrived trucks will wait in the queue if delay.size()=5. There is nothing wrong in this, you should check if your model really works as intended.

The agents would move into delay block immediately if you selected the maximum capacity option in the delay block.

Also instead of timeMeasureStart/End, use your own assignments. That is, inside the delay, on enter type agent.waitStart = time(); and upon leaving type yourHistogramData.add(time()-agent.waitStart);