问题描述
我想在景观中添加森林斑块.更确切地说,其想法是添加补丁集群,例如补丁集群"示例.与本示例相反,我想随机分布一些具有相同颜色的色块群集,而不是几个完全覆盖整个景观的群集.这是代码的开头:
I would like to add forest patches in a landscape. To be more precise, the idea is to add patch clusters like "Patch Clusters" example. Contrary to this example, I want to randomly distribute some patch clusters with the same color and not several clusters that fill entirely the landscape. This is a beginning of code :
to create-forests
repeat 30 [
ask one-of patches [
set pcolor green
ask neighbors [ set pcolor green] ] ]
end
使用此代码,聚类看起来像正方形,而不像补丁聚类"示例那样.如何在景观中添加森林补丁集群?
With this code, the clusters look like squares and not clusters like "Patch Clusters" example. How can I add forest patch clusters in my landscape ?
谢谢您的帮助祝你有美好的一天海军陆战队
Thank you for your helpHave a good dayMarine
推荐答案
诸如此类的事情
to create-forests
ask n-of 10 patches [ set pcolor green ]
repeat 6 [
ask patches with [pcolor = green] [
ask one-of neighbors4 [ set pcolor green ]
]
]
end
结果如下:
The results look like:
这篇关于在景观中添加补丁集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!