Observer Command

set-random-seed `integer`

Sets the random seed to `integer`. Integers allowed are in the range -(2^31) to (2^31 -1).

Note: StarLogo uses the random generator provided by Java, which, as of now, is a linear congruential formula (Knuth Art of Computer Programming, Vol 2, Section 3.2.1.), which uses a 48-bit seed. StarLogo only allows you to set 32 bits of this seed.

Example: One use of set-random-seed would be to have repeatable results. If you want the same "randomness" to occur every time you run your program, simply set the random seed to the same number every time.

Related commands:
random