Setting drop-off block in anylogic

时光总嘲笑我的痴心妄想 提交于 2019-12-25 01:54:21

问题


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?


回答1:


You can find out how many agents are contained in the container by doing container.contents().size()

Let's imagine you want to dropoff 50% in the first and 10% in the second.

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%.

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)

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



来源:https://stackoverflow.com/questions/50091486/setting-drop-off-block-in-anylogic

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!