I realize that my question is just slight modification of questions:
Adding patch clusters in a landscape
How to create cluster patches that do not overlap between them and
but I can't modify them to satisfied my needs.
I need to produce a patchy forest landscape. Each setup, the total area of "green" patches has to be same (20%, 10%... of total count patches) and the size of one blob should be same. Thus: blob_size = area / number_blobs
I suggest that
to create-forests
clear-all
ask n-of 1 patches [ set pcolor green ]
repeat 6 [
ask one-of patches with [pcolor = green ] [
ask one-of neighbors4 with [pcolor = black] [
set pcolor green ]
]
]
end
should be the answer, as by n-of 1 (number_blobs) patches
I create number of blobs needed, and blob_size
is constrained by repeat 6 (blob_size)
. However, in my simple example I have an error ASK expected input to be an agent or agentset but got NOBODY instead.
apparently because one-of patches with [pcolor = green]
has not black neighbors.
Please, how can I include the condition ask one-of patches with [pcolor = green ] and with min-one of neighbors4 with [pcolor = black]
in my code?
Or what is the different way to do this? I need to keep my total area of green patches same, and patches size +- same too, the best would be if they will not overlap. Thank you a lot!