1

私は、円錐視野が 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 ]

3行目。ここで何が問題なのですか?

4

1 に答える 1