NetLogo,访问补丁的颜色 [英] NetLogo, accessing color of a patch

查看:348
本文介绍了NetLogo,访问补丁的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试应用以下条件:

I am trying to apply the following condition:

if ( the color of patch -2 -1 is red )
[
   some commands
]

有人可以告诉我如何在NetLogo中编写吗?

Could someone please tell me how to write this in NetLogo?

推荐答案

if ([pcolor] of patch -2 -1 = red) 
[

]

您几乎可以使用它,但是在代码中,请阅读教程,而不要阅读,这应该很简单.请注意,对补丁使用pcolor,对乌龟使用color.

Pretty much how you put it but in code, read the tutorials and what not and this should be simple. Note that you use pcolor for patches and color for turtles.

祝你好运!

这篇关于NetLogo,访问补丁的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆