Seth -
I'm wondering if there is a reason that the user's random number
generators share the same seed with the internal system's seeds. If
there were two sets of seeds users wouldn't need to say WITH-LOCAL-
RANDOMNESS (nor pay the tiny runtime overhead).
Best,
-ken
--- In netlogo-users%40yahoogroups.com">netlogo-users
yahoogroups.com, Seth Tisue <seth
...> wrote:
>
> >>>>> "suwailems" == suwailems < no_reply%40yahoogroups.com">no_reply
yahoogroups.com> writes:
>
> suwailems> It seems that the generator is sensitive to the number
of
> suwailems> operations performed, even if they have nothing to do
with
> suwailems> the generator.
>
> In NetLogo 3.1 and all later versions, all operations on agentsets
are
> in random order. So even if you just do:
>
> ask patches [ set y (x / 500) + 10 ]
>
> you're actually using the random number generator, since the
patches run
> in random order and that order is determined by the generator.
>
> You can specify a fixed order using SORT or SORT-BY, for example:
>
> foreach sort patches [ ask ? [ ... ] ]
>
> In general, though, there are so many places in NetLogo where the
random
> number generator is used that you may need more general ways of
> controlling the random state. So, in NetLogo 4.0beta3 we
introduced a
> new primitive called WITH-LOCAL-RANDOMNESS. It takes a block of
> commands. Before the commands are run, the state of the random
number
> generator is remembered, and after the commands run, that random
state
> is restored. So if you write:
>
> cmd1
> with-local-randomness [ cmd2 ]
> cmd3
>
> then the same random state that exists after cmd1 runs is used to
run
> cmd2 and then restored and reused for running cmd3.
>
> In the block of commands, you're free to set the random seed if you
> want, to control what random state cmd2 executes under, if that
matters
> to you.
>
> See also the entry for WITH-LOCAL-RANDOMNESS in the NetLogo
Dictionary.
>
> Hope this helps,
>
> --
> Seth Tisue / http://tisue.net
> lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/
>
.