我有一只海龟,其视锥被定义为 5, 120。现在,我希望海龟将最近的海龟与它的朋友颜色相同。我的代码返回错误
this code can't be run by a patch
这是我的代码
turtles-own [ friend ]
to-report checkForAttraction [ agent ]
if [color] of one-of turtles-on empty-patches = [color] of agent [
set friend min-one-of other turtles-on empty-patches with [color = [color] of agent ] [ distance myself ]
set attracted? 1
]
report actualVelocity
end
错误显示在
[color = [color] of agent ]
在第三行。这里有什么问题?