简体   繁体   English

如何检查点节点是否空闲?

[英]How can I check if a Point Node is free?

I'm working on a simulation on Anylogic where there is a buffer for containers in a port. 我正在Anylogic上进行仿真,其中端口中有用于容器的缓冲区。

I use Point Nodes to mark destinations for the containers, but how can I check if there is already a container (an agent) on that Point Node (on that position) ? 我使用点节点标记容器的目的地,但是如何检查该点节点(在该位置)是否已经有容器(代理)?

PS : don't mind my mistakes, english isn't my native language. PS:别管我的错误,英语不是我的母语。

There is no pre-build way as point nodes do not keep track of agents on top of them. 由于点节点不会在其顶部跟踪代理,因此没有预构建方法。 You can have as many as you want. 您可以根据需要拥有任意数量。

So you have to do it manually and there are many ways. 因此,您必须手动进行操作,并且有很多方法。 One suggestion: 一个建议:

create a collection of type LinkedHashMap with key=PointNode and value storing the agent currently at that node. 使用key = PointNode创建一个类型为LinkedHashMap的集合,并值存储当前在该节点上的代理。

This way, you can keep track easily. 这样,您可以轻松跟踪。 (You might need to read up on LinkedHashMaps first, if you don't know them). (如果您不了解,则可能需要先阅读LinkedHashMaps)。

cheers 干杯

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

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