在Anylogic中设置下车区 [英] 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.
在第一个下达中,假设您要下达50%,则可以选择下达选项给定数量,如果可用",并将数量设置为(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中设置下车区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!