Aqeel Tariq
Aqeel Tariq

Reputation: 313

How to stop agent leaving queue when delay + GoTo blocks size = 6 in AnyLogic

i am using queue before the delay block. The delay block capacity is 6. That is great.

But when I use GoTo block I have to make sure the agent only enter in GoTo block when delay.size < 6.

enter image description here

If i use wait block instead of queue then i can free on call function and that will solve my problem but I wana to use queue.

So how to stop agents leaving queue when delay + GoTo blocks size = 6 in AnyLogic

Upvotes: 0

Views: 61

Answers (1)

Benjamin
Benjamin

Reputation: 12795

You put a Hold block between the queue and the ped block. You manage it such that it only opens when the queue size < 6. As soon as an agent enters the queue block and its size is now 7 or larger, you close the hold block.

However, logically you will never have agents leaving the queue ever again because they cannot "drain" elsewhere, so you probably need to tune the logic a bit.

But a "Hold" block is your friend here

Upvotes: 2

Related Questions