分发我的补丁海龟,除了属于一组的那些
Distribute my turtles of patches except ones that are part of a set
所以在这个项目中创建了一个障碍:
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 ]
试试这个 move-to one-of patches with [ not member? self obstacle and not any? turtles-here ]
。您已经通过指定 patches with
告诉 NetLogo 您想要测试 patches
,您不需要为障碍测试重复该操作。
所以在这个项目中创建了一个障碍:
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 ]
试试这个 move-to one-of patches with [ not member? self obstacle and not any? turtles-here ]
。您已经通过指定 patches with
告诉 NetLogo 您想要测试 patches
,您不需要为障碍测试重复该操作。