【发布时间】:2018-04-17 13:41:50
【问题描述】:
我想从补丁半径末端开始向外计算特定颜色的补丁。有 in-radius 命令,但它考虑了补丁中心与其半径之间的空间,但我希望排除这个空间并开始计算半径结束的位置。任何帮助表示赞赏。
哈维尔
【问题讨论】:
-
nitpick:
in-radius不是命令;是记者
标签: netlogo
我想从补丁半径末端开始向外计算特定颜色的补丁。有 in-radius 命令,但它考虑了补丁中心与其半径之间的空间,但我希望排除这个空间并开始计算半径结束的位置。任何帮助表示赞赏。
哈维尔
【问题讨论】:
in-radius 不是命令;是记者
标签: netlogo
如果一个记者使用member? 只返回一个补丁集,该补丁集只包含不是in-radius 的补丁?
to setup
ca
ask n-of 10 patches [ set pcolor white ]
crt 1 [
setxy random-pxcor random-pycor
set color red
set size 2
]
reset-ticks
end
to go
ask turtles [
ask patches in-radius 5 with [ pcolor = black ] [ set pcolor black + 2 ]
print count ( patches-outside-radius 8 ) with [ pcolor = white ]
]
end
to-report patches-outside-radius [ radius ]
let inrad patches in-radius radius
report patches with [ not member? self inrad ]
end
【讨论】: