jeudi 16 mars 2023

Is it possible to create a exponential distribution in netlogo with maximum and minimum values?

Suppose I have X patches, and patches have a patch variable called "patch-quality", with values between 0 and 1. I want to generate a random number between 0 and 1 for that variable following an exponential distribution.

When you set up an exponential distribution in NetLogo, you need a mean:

random-exponential mean

The mean of my exponential distribution is 0.13 (I want most patches to be close to 0 quality).

set patch-quality random-exponential 0.13

The problem is that, sometimes, I got few patches with patch-quality above 1.

Is there a way to generate an exponential distribution in NetLogo that wouldn't generate patches with patch-quality above 1?




Aucun commentaire:

Enregistrer un commentaire