如何让代理搜索他们没有去过 Netlogo 的补丁

问题描述 投票:0回答:0

我想让老鹰飞过这张地图。然而,老鹰只是飞过地图的边缘。边缘是任何不是黑色的东西。

我试过了

ask patches [ ifelse pcolor != 0 and pxcor > 350 or pxcor < 100 [set edge 1][set edge 0 ]]

ask Buteo-platypterus [face max-one-of patches with [edge = 1] [distance myself] fd 5] ```


This makes them go to the edge, but they don't move. I thought that by asking for the max it would always move to the furthest edge, but it didnt. The idea is that the bird goes from edge to edge, say like a ping pong, where as soon as they reach the topmost point they go down and vice-versa. 

The birds start at a random point on the map, so the most first reach the edge of the map, any edge, and then do the ping pong thing. 


[![Image of the map and the birds][1]][1]


 [1]: https://i.stack.imgur.com/vf1br.png
netlogo
© www.soinside.com 2019 - 2024. All rights reserved.