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

use*_*494 6 netlogo

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

在此输入图像描述

Fra*_*can 4

第一次尝试 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
Run Code Online (Sandbox Code Playgroud)