因此,在这个项目中,创建了一个障碍:
set obstacle patches with [ abs(pxcor) < 15 and abs(pycor) < 15 ]
crt 1 [ set size 30 set shape "square" set color gray set heading 0 ]
现在我想在障碍物周围分发我的补丁,但我无法弄清楚如何将它们放在障碍物上的任何地方。所以我正在寻找类似的东西(但这会产生语法错误):
move-to one-of patches with [ patch not obstacle and not any? turtles-here ]
答案 0 :(得分:2)
试试这个move-to one-of patches with [ not member? self obstacle and not any? turtles-here ]
。您已经通过指定patches
告诉NetLogo您想要测试patches with
,您无需重复进行障碍测试。