gpt4 book ai didi

netlogo - 在 NetLogo 中创建给定区域的随机形状( Blob )

转载 作者:行者123 更新时间:2023-12-02 14:30:34 29 4
gpt4 key购买 nike

是否可以在 NetLogo 中创建给定区域的随机形状(例如见下文)?

enter image description here

最佳答案

第一次尝试 Seth 的建议#1。它也创造了一个简洁的视觉效果!

patches-own [ height ]

to blobbify
clear-all
repeat (ceiling 2 * (ln (world-height * world-width))) [
ask patch (round (random (world-width / 2)) - world-width / 4)
(round (random (world-height / 2)) - world-height / 4)
[ set height world-width * world-height ] ]
while [ count patches with [ height > 1 ] < (world-width * world-height / 4)]
[ diffuse height 1
ask patches with [ height > 0 ] [ set pcolor height ]
]
ask patches with [ height > 1 ] [ set pcolor white ]
end

关于netlogo - 在 NetLogo 中创建给定区域的随机形状( Blob ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20997901/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com