Re: User-generated sequence of random numbers
- There's no very good reason to do this anyway. In what way does
Netlogo not give enough control over randomness?
One option you could look at is using R to generate random numbers via
the R extension. That does have the advantage of making a wide range of
additional probability distributions available for use.
- Hi David and others,
I raised this issue because of a discussion we had at work regarding conducting virtual Randomized Controlled Trials to understand the effect of interventions.
The issue came up in the context of a project using non-ABM microsimulations for analyzing effects of interventions. The idea was that with a user-generated sequence of random numbers, even if a modeled individual undergoes or does not undergo a certain process, his quota of random numbers are still consumed (virtually), so that the next person in line for intervention (or control) is not effected by the thus unaltered sequence of random numbers.
It was suggested that something similar should be though of for the ABM part of the project. I admit that I raised this issue in the forum without thinking too much about it. Now, that I have thought it about it a little bit more, it appears that it defeats the purpose of emergence and very basis of ABM - interactions.
Thanks for your input,
--- In email@example.com, David O'Sullivan <d.osullivan@...> wrote:
> There's no very good reason to do this anyway. In what way does
> Netlogo not give enough control over randomness?
> One option you could look at is using R to generate random numbers via
> the R extension. That does have the advantage of making a wide range of
> additional probability distributions available for use.
- If you need some known number of random numbers then you can make a list:
let my-random-floats n-values 100 [random-float 1]
and then have the turtle consume it:
ifelse first my-random-floats < threshold
[ ;; do something ]
[ ;; do something else ]
;; remove item from the list
set my-random-floats but-first my-random-floats
That might suit the framework you are describing. The tricky thing in
getting complete control over random number streams in Netlogo is the
'hidden' randomisations that happen when you do things like ask turtles
(because this shuffles the agentset to randomise the order).
With careful use of with-local-randomness [...] you can control for this.