通过 patch-ahead NetLogo 获取多个补丁

Get multiple patches by patch-ahead NetLogo

patch-ahead distance 报告前面的单个补丁。

如何在前方点的半径范围内获取一组补丁?

你可以让记者为你做这件事,比如:

to-report patches-ahead [ rad dis ] ; turtle reporter
  report [patches in-radius rad] of patch-ahead dis
end

请注意,它必须由乌龟调用-例如:

to setup
  ca
  crt 1
  reset-ticks
end

to go
  ask patches [ 
    set pcolor black
  ]
  ask turtles [
    rt random 61 - 30
    fd 1
    ask patches-ahead 3 7 [ 
      set pcolor white
    ]
  ]
  tick
end