Re: Allow reseeding/rebinding RNG behind rand?

2014-06-04 Thread Linus Ericsson
Sorry, of course i meant the clojure.data.generators library https://github.com/clojure/data.generators esp. the *rnd* that can be bound around many of the functions in the library. /Linus On Wednesday, June 4, 2014, Linus Ericsson wrote: > Data.generative already has this function and many m

Re: Allow reseeding/rebinding RNG behind rand?

2014-06-04 Thread Linus Ericsson
Data.generative already has this function and many more, I realized. /Linus On Wednesday, June 4, 2014, Mars0i wrote: > > > On Wednesday, June 4, 2014 2:55:20 AM UTC-5, Gunnar Völkel wrote: >> >> Once you notice that you usually need a fast solution. >> > > Yes! > > >> The easiest solution is t

Re: Allow reseeding/rebinding RNG behind rand?

2014-06-04 Thread Mars0i
On Wednesday, June 4, 2014 2:55:20 AM UTC-5, Gunnar Völkel wrote: > > Once you notice that you usually need a fast solution. > Yes! > The easiest solution is to just pass around an instance of > java.util.Random which you create with the desired seed. Another options is > to have a constru

Re: Allow reseeding/rebinding RNG behind rand?

2014-06-04 Thread Mars0i
On Tuesday, June 3, 2014 4:56:26 PM UTC-5, Andy Fingerhut wrote: > > This ticket seems to be at least somewhat related to your questions: > > http://dev.clojure.org/jira/browse/CLJ-1420 > > Andy > Yes, thanks for finding that, Andy. It looks like it would address the problem about accessing

Re: Allow reseeding/rebinding RNG behind rand?

2014-06-04 Thread Gunnar Völkel
Once you notice that you usually need a fast solution. The easiest solution is to just pass around an instance of java.util.Random which you create with the desired seed. Another options is to have a constructor function returning a "rand" function. (defn prng [seed] (let [rnd (java.util.Rand

Re: Allow reseeding/rebinding RNG behind rand?

2014-06-03 Thread Andy Fingerhut
This ticket seems to be at least somewhat related to your questions: http://dev.clojure.org/jira/browse/CLJ-1420 Andy On Tue, Jun 3, 2014 at 11:32 AM, Mars0i wrote: > t appears that the random number generator for rand used can't be > reseeded, so there is no way to precisely repeat an ex

Allow reseeding/rebinding RNG behind rand?

2014-06-03 Thread Mars0i
t appears that the random number generator for rand used can't be reseeded, so there is no way to precisely repeat an experiment involving randomness, except by redefining rand. Also, there is no way to specify that rand in different threads should use different RNGs (a strategy discussed in th