在 anylogic 中设置 drop-off 块 [英] Setting drop-off block in anylogic
问题描述
如何设置下车块以在一个火车站卸载一定百分比的人,而在下一火车站卸载不同的百分比?
How can I set the drop-off block to unload a certain percentage of people at one train station and a different percentage at the next train station?
推荐答案
你可以通过执行container.contents().size()
假设您想在第一个中下降 50%,在第二个中下降 10%.
Let's imagine you want to dropoff 50% in the first and 10% in the second.
在第一个 dropoff 中,假设您想要 dropoff 50%,您可以选择选项 dropoff "given number if available" 并将数量设置为 (int)round((container.contents().size()))*0.5)
当然,如果您想降低 30%,您可以将 0.5 更改为 0.3.
In the first dropoff, assuming that you want to dropoff 50% you can choose the option dropoff "given quantity if available" and set the quantity as (int)round((container.contents().size())*0.5)
Of course you can change 0.5 to 0.3 if you want to dropoff 30%.
在下一次减少中,您希望减少初始人口的 10%(但只剩下 50%,因此您希望减少当前人口的 20%(int)round((container.contents().size())*0.2)
In the next dropoff you want to dropoff 10% of the initial population (but only 50% is remaining, so you want to dropoff 20% of the current population
(int)round((container.contents().size())*0.2)
假设您在初始人群中有 100 人,您希望在第一个和第二个分别下车 50% 和 10%(第一个有 50 名乘客,第二个有 10 名乘客)(int)round((container.contents().size())*0.5)
将下车这 50 位乘客,所以您将只剩下 50 位乘客,而在第二个您想要下车 10 位乘客.10,是 50 的 20%……这就是为什么我在第二次下降时使用 0.2
Let's imagine that you have 100 in the initial population and you want to dropoff 50% on the first and 10% on the second (50 passengers in the first and 10 passengers in the second)
(int)round((container.contents().size())*0.5)
will dropoff those 50 passengers, so you will have only 50 passengers left and on the second you want to dropoff 10 passengers. 10, is 20% of 50... that's why I use 0.2 in the second dropoff
这篇关于在 anylogic 中设置 drop-off 块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!