Netlogo(Gis扩展),将代理从一个顶点移动到另一个顶点

时间:2019-04-04 02:22:42

标签: netlogo

我已经建立了具有路网的netlogo gis环境。我创建了两种类型的代理,可以说红色代理和蓝色代理。我还成功地将它们放置在道路网络的顶点上,并且它们能够以随机方式从一个节点(顶点)移动到另一个相邻节点(顶点)。 这个想法是,蓝色主体是固定的,而红色主体需要定位蓝色主体,并从其当前节点(红色主体站在其上的节点)移动到目标节点(蓝色节点)特工站在上)。但是,它们需要穿过相邻节点到达目标节点。

像这样排序 R节点节点1节点2节点3 B节点节点4 (他们需要从R-N到N1,然后从N2,然后到N3,然后从B-N出发)

任何想法如何做到这一点?谢谢

我当时正在考虑在代理所站在的节点(顶点)(蓝色到红色)之间创建链接。然后尝试使用nw:path-to函数将其移动到目标位置。

也欢迎使用其他任何方法:)

ask blue-agents[
set destination-vertex node-blue
;node-blue is the current node there are standing on.
]
ask red-agents
set current-vertex node-red
;node-red is current node red agents are on.
]
ask one-of current-vertex[create-link-with one-of destination-vertex]
;this line doesnt work!

0 个答案:

没有答案