答案 0 :(得分:2)
您可以使用who
,of
,turtles-on
和neighbors
的组合:
turtles-own [ who-of-neighbors ]
to setup
ca
ask patches with [ abs pxcor <= 1 and abs pycor <= 1 ] [ sprout 1 ]
ask turtles [ set who-of-neighbors [ who ] of turtles-on neighbors ]
ask turtles [ show who-of-neighbors ]
end
话虽如此,我不知道你想要这个的原因是什么,但你几乎不应该使用who
。直接使用代理集几乎总是更好。你想存储邻居吗?直接存储turtles-on neighbors
。