List Info

Thread: Re: a few questions about random numbers




Re: a few questions about random numbers
country flaguser name
United States
2008-03-04 09:34:59

Dear Seth,

Thank you very much. I tried to set the random-seed in the setup procedure but the model still runs differently every time. Is there a particular number of random-seed that I need to designate??

Appreciated much,
Nicole

On Mon, Mar 3, 2008 at 12:27 PM, Seth Tisue < sethtisue.net">sethtisue.net> wrote:

>>&gt;>> "Nicole" == Nicole Li < nicole.ykli%40gmail.com" target="_blank">nicole.ykligmail.com> writes:

Nicole&gt; (A) Besides the Netlogo primitives with "random" in their names
Nicole> (e.g., random, random-float, random-normal), what other Netlogo
Nicole> operations/ commands will make random choices? The manual said
Nicole> that the primitives: *one-of, n-of, sprout*, and *downhill* are
Nicole> all governed by random seed. Are there any others???

We don't have a list, but the individual entries in the NetLogo
Dictionary should say if a primitive does something random.

Remember also that *any* operation involving an agentset may use random
numbers, since agentsets are always in random order. So that means most
models make pervasive use of randomness throughout.

Nicole> (B) I'm a bit unclear about the primitive of
Nicole> "*with-local-randomness*&quot;. Besides the examples in the manual,
Nicole> are there any models in Netlogo library using
Nicole> "*with-local-randomness*&quot; and so I can learn more how to use
Nicole> it???

There aren't. It's not a primitive a model would normally use. If
you&#39;re not sure if you need it, you almost certainly don't.

Nicole> (C) Let's say I want to create reproducible model runs. My
Nicole> model has a number of agentsets. Each agentset use different
Nicole> "random" primitives, e.g., the 1st agentset has
Nicole> "*random-normal*", the 2nd agentset has "*sprout*" and the 3rd
Nicole> agentset has "*one-of*". If I want to create reproducible
Nicole> model runs, is that: (1) I need to record the random seed for
Nicole> the first run of the model that I'd like to reproduce, (2) I
Nicole> need to use "with-local-randomess"; for each agentset (???), and
Nicole> (3) I need to use the same random seed as in (1) for the second
Nicole> run? As such, the model will use the same random seed for all
Nicole> the "random" primitives across the agentsets. And the model's
Nicole> outputs will be the same in the first run and the second
Nicole> run. Is that correct?

If you want to a reproducible model run in NetLogo, all you need to do
is set the random seed beforehand. You don't need to do anything else
special. Try it!

Hope this helps,

--
Seth Tisue / http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/




--
Nicole yee-key LI
Doctoral Student
Department of Communication Science and Disorders
University of Pittsburgh

__._,_.___
.

__,_._,___
Re: a few questions about random numbers
country flaguser name
United States
2008-03-04 11:24:54

>>&gt;>> "Nicole" == Nicole Li < nicole.ykli%40gmail.com">nicole.ykligmail.com> writes:

Nicole&gt; Dear Seth, Thank you very much. I tried to set the random-seed
Nicole> in the setup procedure but the model still runs differently
Nicole> every time. Is there a particular number of random-seed that I
Nicole> need to designate??

Your model is probably doing something that depends on external factors.
For example, are you using EVERY? (see my reply to Gary An)

I can't rule out that you've found a bug in NetLogo, but before
suspecting that, you should exclude the possibility that there's
something special in your code that cause the results to vary for other
reasons than varying the random seed.

--
Seth Tisue / http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )