简体   繁体   English

如果延迟已满(容量),则 Anylogic 保持队列

[英]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?如果延迟块已满容量(100),我想保持队列,如果延迟容量下降到 90(等等),我想取消阻塞保持块我该怎么做? 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) (问题是关于一个舞蹈俱乐部,如果舞蹈俱乐部满员,门就会关闭,如果人数回落到 90 人,舞蹈俱乐部就会再次开放)

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.在 Hold 块的属性中,您必须选择手动模式。 Opening and closing the block using the block() and unblock() functions.使用block()unblock()函数打开和关闭块。

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();在你的 Club block 的On enter事件下, if (self.capacity == 99) hold.block();你前面的系统中有 99 个人时,你将关闭。 And under the On exit event of your Club block, you unlock when you leave 90 people behind if (self.capacity == 90) hold.unblock();在你的 Club 块的On exit事件下,当你离开 90 个人时你解锁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)检查号码是 90 还是 91(我不确定在这种情况下他是否已经错过了特定代理人)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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