Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
whrandom Namespace Reference

Data Structures

class  whrandom
 

Variables

tuple _inst = whrandom()
 
 seed = _inst.seed
 
 random = _inst.random
 
 uniform = _inst.uniform
 
 randint = _inst.randint
 
 choice = _inst.choice
 
 randrange = _inst.randrange
 

Detailed Description

Wichman-Hill random number generator.

Wichmann, B. A. & Hill, I. D. (1982)
Algorithm AS 183:
An efficient and portable pseudo-random number generator
Applied Statistics 31 (1982) 188-190

see also:
    Correction to Algorithm AS 183
    Applied Statistics 33 (1984) 123

    McLeod, A. I. (1985)
    A remark on Algorithm AS 183
    Applied Statistics 34 (1985),198-200


USE:
whrandom.random()       yields double precision random numbers
                    uniformly distributed between 0 and 1.

whrandom.seed(x, y, z)  must be called before whrandom.random()
                    to seed the generator

There is also an interface to create multiple independent
random generators, and to choose from other ranges.



Multi-threading note: the random number generator used here is not
thread-safe; it is possible that nearly simultaneous calls in
different theads return the same random value.  To avoid this, you
have to use a lock around all calls.  (I didn't want to slow this
down in the serial case by using a lock here.)

Variable Documentation

tuple _inst = whrandom()

Definition at line 134 of file whrandom.py.

choice = _inst.choice

Definition at line 139 of file whrandom.py.

randint = _inst.randint

Definition at line 138 of file whrandom.py.

random = _inst.random

Definition at line 136 of file whrandom.py.

randrange = _inst.randrange

Definition at line 140 of file whrandom.py.

seed = _inst.seed

Definition at line 135 of file whrandom.py.

uniform = _inst.uniform

Definition at line 137 of file whrandom.py.