I'm writing to have an explanation about checking probabilities in a model built by NetLogo. I have a circumstance that can happen with a probability, for example, of 60%... Thus I generate a number with
let trial random 100
So, it's not clear to me if I have to verifiy that trial is greater than 60 or lower equal than 60, so that the probability is satisfied.
Which is the correct way? Thank you
You need to check if the result is less than the probability (not less than or equal). For example:
if random 100 < 60 [
do-something
]
Using random 100 will give you a number between 0 and 99 (inclusive). In the example, numbers 0 to 59 will meet the condition, i.e., 60 numbers out of the 100 possible numbers: a 60% probability.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With