如何在任何logic中计数特定区域中的行人或其他计算
现在,我设置了三个服务,让行人在任何logic中都在targetline1和targetline2之间行驶。行人的一部分将进入服务,然后转到Targetline1或2。我想仅计算节点中的行人总数(蓝色矩形)。
如何仅在节点区域计算行人?
(我还想计算其他内容,例如该节点中的总平均速度和每秒密度,并且不想计算服务中的行人。是否有任何代码可以用作条件,以便只有行人进入该条件节点被计算吗?)
谢谢!
Now I set three services and let pedestrians run between the targetline1 and targetline2 in anylogic. Part of pedestrians will enter into services and then go to the targetline1 or 2. I want to count the total number of pedestrians only in the node(blue rectangular).
how can I calculate pedestrians only in the node area?
(I also want to calculate other things such as the total average speed and density per second in this node, and don't want to calculate pedestrians in services. Is there any code that can be used as a condition so that only pedestrians entering the node are counted?)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
区域节点具有应用“访问限制”时可以使用的代码框。只需将其设置为

infinity
如下(编辑:您需要将其设置为integer.max_value
而不是!)。现在,每当ped进入/退出时,您都可以计算并进行学习:对于平均速度等,您可以使用定期对节点中所有PED计算的循环事件。只需将/删除PED(使用下面的Enter/Exit Code字段)添加到本地集合中,然后在该集合中的所有PED上循环循环,以在其上进行计算。
Area nodes have code boxes you can use if you apply "access restriction". Just set it to

infinity
as below (EDIT: You need to set it toInteger.MAX_VALUE
instead!). Now you can count whenever a ped enters/exits, and do your studies:For average speeds, etc., you can use a cyclic event that regularly does calcs for all peds in your node. Simply add/remove peds (using the enter/exit code fields below) into a local collection and loop across all peds in that collection to do calcs across them.