vendredi 5 août 2016

Create clusters of patches without changing occurrence

I am writing a Netlogo model which only involves patches. I have managed to create a landscape consisting of patches of 6 different colours (each representing a different vegetation in my project) according to probability. So red patches have a probability of 10% to occur on each patch, yellow 5%, brown 20% and so on.

An example of my code where this probability is set up:

    let i random-float 1
    ifelse i + random-float 0.1 <= 0.8 ;random 0.1 threshold for environmental noise
      [ set pcolor green ]
      [ ifelse i + random-float 0.1 <= 0.9
        [ set pcolor yellow ]
        [ set pcolor blue ] ]

However, this creates a random pattern for each colour. But I would like to create a clustered spatial pattern for one of them.Specifically, in my landscape, I want the proportion of brown patches to be 50%. But if I were to set this 50% probability for every patch, the brown patches will be randomly distributed. How do I get it to occupy 50% of my landscape, but appear in a clustered pattern?

I tried creating the clustered pattern using the Moore neighbourhood, but that obviously changes the proportion of brown patches.

I hope this is somewhat clear. Thanks for any help in advance.

Aucun commentaire:

Enregistrer un commentaire