"dan" <(EMail Removed)> wrote in message
news:(EMail Removed) om...
> just a suggestion 
>
> next time the core RNG is changed, I think it would be useful to have
> an
> oldrandom switch. It is common practice in simulation projects to
> depend
> on the fact that your random numbers will come out the same if you use
> the same seed. In bumping to 2.3 with the new Mersenne algorithm, I
> have no easy way of duplicating my old results.
It would have been helpful to included a sample call, the results, and
the version of Python you were using. It looks like you were using
Py2.0 and upgraded to Py2.3. This difference you are seeing came
version Py2.1 when WichmannHill's seed method was improved
(the upgrade to the Mersenne Twister has nothing to do with it):
"""
random.py's seed() function is new. For bitforbit compatibility with
prior releases, use the whseed function instead. The new seed function
addresses two problems: (1) The old function couldn't produce more than
about 2**24 distinct internal states; the new one about 2**45 (the best
that can be done in the WichmannHill generator). (2) The old function
sometimes produced identical internal states when passed distinct
integers, and there was no simple way to predict when that would happen;
the new one guarantees to produce distinct internal states for all
arguments in [0, 27814431486576L).
"""
So, to get your old results with Py2.3, try something like:
import random
rng = random.WichmannHill()
rng.whseed(12345)
for i in range(6):
print rng.randint(1, 10)
Raymond Hettinger
