简体   繁体   中英

Anylogic Hold a queue if a Delay is full (capacity)

I would like to hold the queue if the delay block is full of capacity (100) and unblock the hold block if the delay capacity drops down to 90 (and so on) How can i do it? Thank you.

(The question is for a dance club where if the dance club goes full the doors get closed and if it drops back to 90 people the dance club opens again)

Example

I dont now how to write the code nor where to do it.

In the properties of the Hold block you must select Manual mode. Opening and closing the block using the block() and unblock() functions.

Under the On enter event of your Club block, you close when there are 99 people in the system ahead of you if (self.capacity == 99) hold.block(); And under the On exit event of your Club block, you unlock when you leave 90 people behind if (self.capacity == 90) hold.unblock();

Check if the number is 90 or 91 (I'm not sure if in this event he already missed the specific agent)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM