如何找到所需龟的邻居补丁而不是乌龟自己的邻居。所以要找出特定海龟的空邻居作为种子或固定龟,并要求其他海龟去那里停下来。
我正在使用命令的邻居,但它总是看到自己的邻居。还想使用(fd 1)
而不是(move-to)
命令
ask turtles with [stationary? != true and seed? = false] [
let empty-patches neighbors with [not any? robots-here with [stationary? = true]]
ifelse any? empty-patches
[ let target one-of empty-patches
face target
fd 0.1
]
[
set stationary? true
set localized? true
stop
]
]
end