Search code examples
anylogic

Suspend and resume a queue in the seize block


So I have a classic process consisting of source -> seize -> delay -> release -> sink.

Now, every 5th hour I want to suspend the embedded queue in "seize" for 1 hour, then resume it after that 1 hour has passed.

How can this be achieved?


Solution

  • Tons of options, here is one:

    1. make a new resource pool that has tons of resources
    2. set up a new "Downtime" block and set it up for your 5-hrly breaks
    3. Make your Seize block seize 1 resources from the new pool as well

    Now, whenever the new resources are on a break, the seizing will be paused.

    Another option:

    1. set the seize queue size to 1
    2. put a Queue object before the Seize (this now acts as the actual queue)
    3. put a hold block between the queue and the seize block
    4. govern the Hold block as needed (maybe from a state chart or event)