netlogo检查补丁颜色

时间:2010-08-20 23:39:15

标签: netlogo

用简单的话说,我正在努力做的是:

if(任何补丁的颜色=红色)然后执行一些代码

2 个答案:

答案 0 :(得分:3)

if any? patches with [pcolor = red] [
  print "yes, there is at least one red patch"
]

答案 1 :(得分:0)

只有一只乌龟可以检查pcolor。所以这有效:

ask turtles [show pcolor]

但这不起作用(输入Observer>提示符):

show pcolor