swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Query: Spatially uncorrelated reproducible random values


From: Paul E Johnson
Subject: Re: Query: Spatially uncorrelated reproducible random values
Date: Wed, 02 Aug 2000 12:33:11 -0500

Nigel Gilbert wrote:
> 
> Thus what I need is a function that
> has the location coordinates as inputs and the fitness value as the
> output, where the fitness value is a random number with no 'spatial'
> correlation with the coordinates.
> 
> Conventional discussions of random number generators assume that what
> you want is a random number stream, rather than a random mapping. Any
> ideas?
Hello, Nigel!

Here is what I would do.  First, get a unique integer for each possible
position in the multidimensional space.  I was looking at Swarm's Grid2d
today and you can see the way they do it there, which is supposed to be
a bit faster.  

But for clarity, if you just say, for a point (x,y) the location is
(x+y*ysize), you will get a unique integer, call it INTEGER.

Then, when you need a random number uncorrelated to  the coordinates,
use the value INTEGER as the seed of a random number generator.  Reseed
with INTEGER whenever you need to sample. That way, for each location,
you always get exactly the same number back, and it will be what you
want.

-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700


                  ==================================
   Swarm-Modelling is for discussion of Simulation and Modelling techniques
   esp. using Swarm.  For list administration needs (esp. [un]subscribing),
   please send a message to <address@hidden> with "help" in the
   body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]