RDRandom

Module RDRandom |
[hide private]
[frames] | no frames]

# Source Code for Module RDRandom

     1  # $Id: RDRandom.py 2 2006-05-06 22:54:39Z glandrum $
     2  #
     3  #  Copyright (C) 2003-2006  Greg Landrum and Rational Discovery LLC
     4  #
     5  #   @@ All Rights Reserved  @@
     6  #
     7  """ making random numbers consistent so we get good regressions
     8
     9  """
    10
    11  import sys
    12
    13  import random as _random
    14  if sys.hexversion >= 0x20303f0:
    15    _randGen = _random.WichmannHill()
    16    random = _randGen.random
    17    randrange = _randGen.randrange
    18 -  def seed(val):
    19      global _randGen,random,randrange
    20      _randGen = _random.WichmannHill()
    21      _randGen.whseed(val)
    22      random = _randGen.random
    23      randrange = _randGen.randrange
    24  else:
    25    random = _random.random
    26    randrange = _random.randrange
    27    seed = _random.whseed
    28