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

Data Structures

class  Random
 

Functions

def seed
 --------------—— core generator -------------—— More...
 
def random
 
def getstate
 
def setstate
 
def jumpahead
 
def whseed
 
def __getstate__
 -— Methods below this point do not need to be overridden when -— subclassing for the purpose of using a different core generator. More...
 
def __setstate__
 
def randrange
 --------------—— integer methods -------------—— More...
 
def randint
 
def choice
 --------------—— sequence methods -------------—— More...
 
def shuffle
 
def uniform
 -----------——— real-valued distributions ----------——— More...
 
def normalvariate
 -----------------— normal distribution -----------------— More...
 
def lognormvariate
 -----------------— lognormal distribution -----------------— More...
 
def cunifvariate
 -----------------— circular uniform -----------------— More...
 
def expovariate
 -----------------— exponential distribution -----------------— More...
 
def vonmisesvariate
 -----------------— von Mises distribution -----------------— More...
 
def gammavariate
 -----------------— gamma distribution -----------------— More...
 
def stdgamma
 
def gauss
 -----------------— Gauss (faster alternative) -----------------— More...
 
def betavariate
 -----------------— beta -----------------— See http://sourceforge.net/bugs/?func=detailbug&bug_id=130030&group_id=5470 for Ivan Frohne's insightful analysis of why the original implementation: More...
 
def paretovariate
 -----------------— Pareto -----------------— More...
 
def weibullvariate
 -----------------— Weibull -----------------— More...
 

Variables

float _pi = 3.1415926536
 
float _e = 2.7182818284590451
 
list __all__
 
int NV_MAGICCONST = 4
 
float TWOPI = 2.0
 
tuple LOG4 = _log(4.0)
 
float SG_MAGICCONST = 1.0
 
tuple _inst = Random()
 
 seed = _inst.seed
 
 random = _inst.random
 
 uniform = _inst.uniform
 
 randint = _inst.randint
 
 choice = _inst.choice
 
 randrange = _inst.randrange
 
 shuffle = _inst.shuffle
 
 normalvariate = _inst.normalvariate
 
 lognormvariate = _inst.lognormvariate
 
 cunifvariate = _inst.cunifvariate
 
 expovariate = _inst.expovariate
 
 vonmisesvariate = _inst.vonmisesvariate
 
 gammavariate = _inst.gammavariate
 
 stdgamma = _inst.stdgamma
 
 gauss = _inst.gauss
 
 betavariate = _inst.betavariate
 
 paretovariate = _inst.paretovariate
 
 weibullvariate = _inst.weibullvariate
 
 getstate = _inst.getstate
 
 setstate = _inst.setstate
 
 jumpahead = _inst.jumpahead
 
 whseed = _inst.whseed
 
 _seed
 
 gauss_next
 

Detailed Description

Random variable generators.

    integers
    --------
           uniform within range

    sequences
    ---------
           pick random element
           generate random permutation

    distributions on the real line:
    ------------------------------
           uniform
           normal (Gaussian)
           lognormal
           negative exponential
           gamma
           beta

    distributions on the circle (angles 0 to 2pi)
    ---------------------------------------------
           circular uniform
           von Mises

Translated from anonymously contributed C/C++ source.

Multi-threading note:  the random number generator used here is not thread-
safe; it is possible that two calls return the same random value.  However,
you can instantiate a different instance of Random() in each thread to get
generators that don't share state, then use .setstate() and .jumpahead() to
move the generators to disjoint segments of the full period.  For example,

def create_generators(num, delta, firstseed=None):
    ""\"Return list of num distinct generators.
    Each generator has its own unique segment of delta elements from
    Random.random()'s full period.
    Seed the first generator with optional arg firstseed (default is
    None, to seed from current time).
    ""\"

    from random import Random
    g = Random(firstseed)
    result = [g]
    for i in range(num - 1):
        laststate = g.getstate()
        g = Random()
        g.setstate(laststate)
        g.jumpahead(delta)
        result.append(g)
    return result

gens = create_generators(10, 1000000)

That creates 10 distinct generators, which can be passed out to 10 distinct
threads.  The generators don't share state so can be called safely in
parallel.  So long as no thread calls its g.random() more than a million
times (the second argument to create_generators), the sequences seen by
each thread will not overlap.

The period of the underlying Wichmann-Hill generator is 6,953,607,871,644,
and that limits how far this technique can be pushed.

Just for fun, note that since we know the period, .jumpahead() can also be
used to "move backward in time":

>>> g = Random(42)  # arbitrary
>>> g.random()
0.25420336316883324
>>> g.jumpahead(6953607871644L - 1) # move *back* one
>>> g.random()
0.25420336316883324

Function Documentation

def vsrandom.__getstate__ (   self)

-— Methods below this point do not need to be overridden when -— subclassing for the purpose of using a different core generator.

-----------------— pickle support ----------------—

Definition at line 270 of file vsrandom.py.

271  def __getstate__(self): # for pickle
272  return self.getstate()
def vsrandom.__setstate__ (   self,
  state 
)

Definition at line 273 of file vsrandom.py.

274  def __setstate__(self, state): # for pickle
275  self.setstate(state)
def vsrandom.betavariate (   self,
  alpha,
  beta 
)

-----------------— beta -----------------— See http://sourceforge.net/bugs/?func=detailbug&bug_id=130030&group_id=5470 for Ivan Frohne's insightful analysis of why the original implementation:

def betavariate(self, alpha, beta):

Discrete Event Simulation in C, pp 87-88.

y = self.expovariate(alpha) z = self.expovariate(1.0/beta) return z/(y+z)

was dead wrong, and how it probably got that way.

Definition at line 551 of file vsrandom.py.

References betavariate.

552  def betavariate(self, alpha, beta):
553  # This version due to Janne Sinkkonen, and matches all the std
554  # texts (e.g., Knuth Vol 2 Ed 3 pg 134 "the beta distribution").
555  y = self.gammavariate(alpha, 1.)
556  if y == 0:
557  return 0.0
558  else:
559  return y / (y + self.gammavariate(beta, 1.))
def vsrandom.choice (   self,
  seq 
)

--------------—— sequence methods -------------——

Choose a random element from a non-empty sequence.

Definition at line 327 of file vsrandom.py.

References choice.

328  def choice(self, seq):
329  """Choose a random element from a non-empty sequence."""
330  return seq[int(self.random() * len(seq))]
def vsrandom.cunifvariate (   self,
  mean,
  arc 
)

-----------------— circular uniform -----------------—

Definition at line 385 of file vsrandom.py.

References cunifvariate.

386  def cunifvariate(self, mean, arc):
387  # mean: mean angle (in radians between 0 and pi)
388  # arc: range of distribution (in radians between 0 and pi)
389 
390  return (mean + arc * (self.random() - 0.5)) % _pi
def vsrandom.expovariate (   self,
  lambd 
)

-----------------— exponential distribution -----------------—

Definition at line 393 of file vsrandom.py.

References expovariate.

394  def expovariate(self, lambd):
395  # lambd: rate lambd = 1/mean
396  # ('lambda' is a Python reserved word)
397 
398  random = self.random
399  u = random()
400  while u <= 1e-7:
401  u = random()
402  return -_log(u)/lambd
def vsrandom.gammavariate (   self,
  alpha,
  beta 
)

-----------------— gamma distribution -----------------—

Definition at line 447 of file vsrandom.py.

References gammavariate.

448  def gammavariate(self, alpha, beta):
449  # beta times standard gamma
450  ainv = _sqrt(2.0 * alpha - 1.0)
451  return beta * self.stdgamma(alpha, ainv, alpha - LOG4, alpha + ainv)
def vsrandom.gauss (   self,
  mu,
  sigma 
)

-----------------— Gauss (faster alternative) -----------------—

Definition at line 506 of file vsrandom.py.

References gauss.

507  def gauss(self, mu, sigma):
508 
509  # When x and y are two variables from [0, 1), uniformly
510  # distributed, then
511  #
512  # cos(2*pi*x)*sqrt(-2*log(1-y))
513  # sin(2*pi*x)*sqrt(-2*log(1-y))
514  #
515  # are two *independent* variables with normal distribution
516  # (mu = 0, sigma = 1).
517  # (Lambert Meertens)
518  # (corrected version; bug discovered by Mike Miller, fixed by LM)
519 
520  # Multithreading note: When two threads call this function
521  # simultaneously, it is possible that they will receive the
522  # same return value. The window is very small though. To
523  # avoid this, you have to use a lock around all calls. (I
524  # didn't want to slow this down in the serial case by using a
525  # lock here.)
526 
527  random = self.random
528  z = self.gauss_next
529  self.gauss_next = None
530  if z is None:
531  x2pi = random() * TWOPI
532  g2rad = _sqrt(-2.0 * _log(1.0 - random()))
533  z = _cos(x2pi) * g2rad
534  self.gauss_next = _sin(x2pi) * g2rad
535 
536  return mu + z*sigma
def vsrandom.getstate (   self)
Return internal state; can be passed to setstate() later.

Definition at line 185 of file vsrandom.py.

References getstate.

186  def getstate(self):
187  """Return internal state; can be passed to setstate() later."""
188  return self.VERSION, self._seed, self.gauss_next
def vsrandom.jumpahead (   self,
  n 
)
Act as if n calls to random() were made, but quickly.

n is an int, greater than or equal to 0.

Example use:  If you have 2 threads and know that each will
consume no more than a million random numbers, create two Random
objects r1 and r2, then do
    r2.setstate(r1.getstate())
    r2.jumpahead(1000000)
Then r1 and r2 will use guaranteed-disjoint segments of the full
period.

Definition at line 199 of file vsrandom.py.

References jumpahead.

200  def jumpahead(self, n):
201  """Act as if n calls to random() were made, but quickly.
202 
203  n is an int, greater than or equal to 0.
204 
205  Example use: If you have 2 threads and know that each will
206  consume no more than a million random numbers, create two Random
207  objects r1 and r2, then do
208  r2.setstate(r1.getstate())
209  r2.jumpahead(1000000)
210  Then r1 and r2 will use guaranteed-disjoint segments of the full
211  period.
212  """
213 
214  if not n >= 0:
215  raise ValueError("n must be >= 0")
216  x, y, z = self._seed
217  x = int(x * pow(171, n, 30269)) % 30269
218  y = int(y * pow(172, n, 30307)) % 30307
219  z = int(z * pow(170, n, 30323)) % 30323
220  self._seed = x, y, z
def vsrandom.lognormvariate (   self,
  mu,
  sigma 
)

-----------------— lognormal distribution -----------------—

Definition at line 380 of file vsrandom.py.

References lognormvariate.

381  def lognormvariate(self, mu, sigma):
382  return _exp(self.normalvariate(mu, sigma))
def vsrandom.normalvariate (   self,
  mu,
  sigma 
)

-----------------— normal distribution -----------------—

Definition at line 360 of file vsrandom.py.

References normalvariate.

361  def normalvariate(self, mu, sigma):
362  # mu = mean, sigma = standard deviation
363 
364  # Uses Kinderman and Monahan method. Reference: Kinderman,
365  # A.J. and Monahan, J.F., "Computer generation of random
366  # variables using the ratio of uniform deviates", ACM Trans
367  # Math Software, 3, (1977), pp257-260.
368 
369  random = self.random
370  while 1:
371  u1 = random()
372  u2 = random()
373  z = NV_MAGICCONST*(u1-0.5)/u2
374  zz = z*z/4.0
375  if zz <= -_log(u2):
376  break
377  return mu + z*sigma
def vsrandom.paretovariate (   self,
  alpha 
)

-----------------— Pareto -----------------—

Definition at line 562 of file vsrandom.py.

References paretovariate.

563  def paretovariate(self, alpha):
564  # Jain, pg. 495
565 
566  u = self.random()
567  return 1.0 / pow(u, 1.0/alpha)
def vsrandom.randint (   self,
  a,
  b 
)
Return random integer in range [a, b], including both end points.

(Deprecated; use randrange(a, b+1).)

Definition at line 317 of file vsrandom.py.

References randint.

318  def randint(self, a, b):
319  """Return random integer in range [a, b], including both end points.
320 
321  (Deprecated; use randrange(a, b+1).)
322  """
323 
324  return self.randrange(a, b+1)
def vsrandom.random (   self)
Get the next random number in the range [0.0, 1.0).

Definition at line 154 of file vsrandom.py.

References random.

155  def random(self):
156  """Get the next random number in the range [0.0, 1.0)."""
157 
158  # Wichman-Hill random number generator.
159  #
160  # Wichmann, B. A. & Hill, I. D. (1982)
161  # Algorithm AS 183:
162  # An efficient and portable pseudo-random number generator
163  # Applied Statistics 31 (1982) 188-190
164  #
165  # see also:
166  # Correction to Algorithm AS 183
167  # Applied Statistics 33 (1984) 123
168  #
169  # McLeod, A. I. (1985)
170  # A remark on Algorithm AS 183
171  # Applied Statistics 34 (1985),198-200
172 
173  # This part is thread-unsafe:
174  # BEGIN CRITICAL SECTION
175  x, y, z = self._seed
176  x = (171 * x) % 30269
177  y = (172 * y) % 30307
178  z = (170 * z) % 30323
179  self._seed = x, y, z
180  # END CRITICAL SECTION
181 
182  # Note: on a platform using IEEE-754 double arithmetic, this can
183  # never return 0.0 (asserted by Tim; proof too long for a comment).
184  return (x/30269.0 + y/30307.0 + z/30323.0) % 1.0
def vsrandom.randrange (   self,
  start,
  stop = None,
  step = 1,
  int = int,
  default = None 
)

--------------—— integer methods -------------——

Choose a random item from range(start, stop[, step]).

This fixes the problem with randint() which includes the
endpoint; in Python this is usually not what you want.
Do not supply the 'int' and 'default' arguments.

Definition at line 278 of file vsrandom.py.

References randrange.

279  def randrange(self, start, stop=None, step=1, int=int, default=None):
280  """Choose a random item from range(start, stop[, step]).
281 
282  This fixes the problem with randint() which includes the
283  endpoint; in Python this is usually not what you want.
284  Do not supply the 'int' and 'default' arguments.
285  """
286 
287  # This code is a bit messy to make it fast for the
288  # common case while still doing adequate error checking
289  istart = int(start)
290  if istart != start:
291  raise ValueError, "non-integer arg 1 for randrange()"
292  if stop is default:
293  if istart > 0:
294  return int(self.random() * istart)
295  raise ValueError, "empty range for randrange()"
296  istop = int(stop)
297  if istop != stop:
298  raise ValueError, "non-integer stop for randrange()"
299  if step == 1:
300  if istart < istop:
301  return istart + int(self.random() *
302  (istop - istart))
303  raise ValueError, "empty range for randrange()"
304  istep = int(step)
305  if istep != step:
306  raise ValueError, "non-integer step for randrange()"
307  if istep > 0:
308  n = (istop - istart + istep - 1) / istep
309  elif istep < 0:
310  n = (istop - istart + istep + 1) / istep
311  else:
312  raise ValueError, "zero step for randrange()"
313 
314  if n <= 0:
315  raise ValueError, "empty range for randrange()"
316  return istart + istep*int(self.random() * n)
def vsrandom.seed (   self,
  a = None 
)

--------------—— core generator -------------——

Initialize internal state from hashable object.

None or no argument seeds from current time.

If a is not None or an int or long, hash(a) is used instead.

If a is an int or long, a is used directly.  Distinct values between
0 and 27814431486575L inclusive are guaranteed to yield distinct
internal states (this guarantee is specific to the default
Wichmann-Hill generator).

Definition at line 128 of file vsrandom.py.

References seed.

129  def seed(self, a=None):
130  """Initialize internal state from hashable object.
131 
132  None or no argument seeds from current time.
133 
134  If a is not None or an int or long, hash(a) is used instead.
135 
136  If a is an int or long, a is used directly. Distinct values between
137  0 and 27814431486575L inclusive are guaranteed to yield distinct
138  internal states (this guarantee is specific to the default
139  Wichmann-Hill generator).
140  """
141 
142  if a is None:
143  # Initialize from current time
144  import VS
145  a = long(VS.timeofday() * 256)
146 
147  if type(a) not in (type(3), type(3L)):
148  a = hash(a)
149 
150  a, x = divmod(a, 30268)
151  a, y = divmod(a, 30306)
152  a, z = divmod(a, 30322)
153  self._seed = int(x)+1, int(y)+1, int(z)+1
def vsrandom.setstate (   self,
  state 
)
Restore internal state from object returned by getstate().

Definition at line 189 of file vsrandom.py.

References setstate.

190  def setstate(self, state):
191  """Restore internal state from object returned by getstate()."""
192  version = state[0]
193  if version == 1:
194  version, self._seed, self.gauss_next = state
195  else:
196  raise ValueError("state with version %s passed to "
197  "Random.setstate() of version %s" %
198  (version, self.VERSION))
def vsrandom.shuffle (   self,
  x,
  random = None,
  int = int 
)
x, random=random.random -> shuffle list x in place; return None.

Optional arg random is a 0-argument function returning a random
float in [0.0, 1.0); by default, the standard random.random.

Note that for even rather small len(x), the total number of
permutations of x is larger than the period of most random number
generators; this implies that "most" permutations of a long
sequence can never be generated.

Definition at line 331 of file vsrandom.py.

References shuffle.

332  def shuffle(self, x, random=None, int=int):
333  """x, random=random.random -> shuffle list x in place; return None.
334 
335  Optional arg random is a 0-argument function returning a random
336  float in [0.0, 1.0); by default, the standard random.random.
337 
338  Note that for even rather small len(x), the total number of
339  permutations of x is larger than the period of most random number
340  generators; this implies that "most" permutations of a long
341  sequence can never be generated.
342  """
343 
344  if random is None:
345  random = self.random
346  for i in xrange(len(x)-1, 0, -1):
347  # pick an element in x[:i+1] with which to exchange x[i]
348  j = int(random() * (i+1))
349  x[i], x[j] = x[j], x[i]
def vsrandom.stdgamma (   self,
  alpha,
  ainv,
  bbb,
  ccc 
)

Definition at line 452 of file vsrandom.py.

References stdgamma.

453  def stdgamma(self, alpha, ainv, bbb, ccc):
454  # ainv = sqrt(2 * alpha - 1)
455  # bbb = alpha - log(4)
456  # ccc = alpha + ainv
457 
458  random = self.random
459  if alpha <= 0.0:
460  raise ValueError, 'stdgamma: alpha must be > 0.0'
461 
462  if alpha > 1.0:
463 
464  # Uses R.C.H. Cheng, "The generation of Gamma
465  # variables with non-integral shape parameters",
466  # Applied Statistics, (1977), 26, No. 1, p71-74
467 
468  while 1:
469  u1 = random()
470  u2 = random()
471  v = _log(u1/(1.0-u1))/ainv
472  x = alpha*_exp(v)
473  z = u1*u1*u2
474  r = bbb+ccc*v-x
475  if r + SG_MAGICCONST - 4.5*z >= 0.0 or r >= _log(z):
476  return x
477 
478  elif alpha == 1.0:
479  # expovariate(1)
480  u = random()
481  while u <= 1e-7:
482  u = random()
483  return -_log(u)
484 
485  else: # alpha is between 0 and 1 (exclusive)
486 
487  # Uses ALGORITHM GS of Statistical Computing - Kennedy & Gentle
488 
489  while 1:
490  u = random()
491  b = (_e + alpha)/_e
492  p = b*u
493  if p <= 1.0:
494  x = pow(p, 1.0/alpha)
495  else:
496  # p > 1
497  x = -_log((b-p)/alpha)
498  u1 = random()
499  if not (((p <= 1.0) and (u1 > _exp(-x))) or
500  ((p > 1) and (u1 > pow(x, alpha - 1.0)))):
501  break
502  return x
503 
def vsrandom.uniform (   self,
  a,
  b 
)

-----------——— real-valued distributions ----------———

--------------—— uniform distribution -------------——

Get a random number in the range [a, b).

Definition at line 354 of file vsrandom.py.

References uniform.

355  def uniform(self, a, b):
356  """Get a random number in the range [a, b)."""
357  return a + (b-a) * self.random()
def vsrandom.vonmisesvariate (   self,
  mu,
  kappa 
)

-----------------— von Mises distribution -----------------—

Definition at line 405 of file vsrandom.py.

References vonmisesvariate.

406  def vonmisesvariate(self, mu, kappa):
407  # mu: mean angle (in radians between 0 and 2*pi)
408  # kappa: concentration parameter kappa (>= 0)
409  # if kappa = 0 generate uniform random angle
410 
411  # Based upon an algorithm published in: Fisher, N.I.,
412  # "Statistical Analysis of Circular Data", Cambridge
413  # University Press, 1993.
414 
415  # Thanks to Magnus Kessler for a correction to the
416  # implementation of step 4.
417 
418  random = self.random
419  if kappa <= 1e-6:
420  return TWOPI * random()
421 
422  a = 1.0 + _sqrt(1.0 + 4.0 * kappa * kappa)
423  b = (a - _sqrt(2.0 * a))/(2.0 * kappa)
424  r = (1.0 + b * b)/(2.0 * b)
425 
426  while 1:
427  u1 = random()
428 
429  z = _cos(_pi * u1)
430  f = (1.0 + r * z)/(r + z)
431  c = kappa * (r - f)
432 
433  u2 = random()
434 
435  if not (u2 >= c * (2.0 - c) and u2 > c * _exp(1.0 - c)):
436  break
437 
438  u3 = random()
439  if u3 > 0.5:
440  theta = (mu % TWOPI) + _acos(f)
441  else:
442  theta = (mu % TWOPI) - _acos(f)
443 
444  return theta
def vsrandom.weibullvariate (   self,
  alpha,
  beta 
)

-----------------— Weibull -----------------—

Definition at line 570 of file vsrandom.py.

References pre.compile(), getstate, jumpahead, sre_parse.max, sre_parse.min, setstate, and weibullvariate.

571  def weibullvariate(self, alpha, beta):
572  # Jain, pg. 499; bug fix courtesy Bill Arms
573 
574  u = self.random()
575  return alpha * pow(-_log(u), 1.0/beta)
def vsrandom.whseed (   self,
  a = None 
)
Seed from hashable object's hash code.

None or no argument seeds from current time.  It is not guaranteed
that objects with distinct hash codes lead to distinct internal
states.

This is obsolete, provided for compatibility with the seed routine
used prior to Python 2.1.  Use the .seed() method instead.

Definition at line 242 of file vsrandom.py.

References whseed.

243  def whseed(self, a=None):
244  """Seed from hashable object's hash code.
245 
246  None or no argument seeds from current time. It is not guaranteed
247  that objects with distinct hash codes lead to distinct internal
248  states.
249 
250  This is obsolete, provided for compatibility with the seed routine
251  used prior to Python 2.1. Use the .seed() method instead.
252  """
253 
254  if a is None:
255  self.__whseed()
256  return
257  a = hash(a)
258  a, x = divmod(a, 256)
259  a, y = divmod(a, 256)
260  a, z = divmod(a, 256)
261  x = (x + a) % 256 or 1
262  y = (y + a) % 256 or 1
263  z = (z + a) % 256 or 1
264  self.__whseed(x, y, z)

Variable Documentation

list __all__
Initial value:
1 = ["Random","seed","random","uniform","randint","choice",
2  "randrange","shuffle","normalvariate","lognormvariate",
3  "cunifvariate","expovariate","vonmisesvariate","gammavariate",
4  "stdgamma","gauss","betavariate","paretovariate","weibullvariate",
5  "getstate","setstate","jumpahead","whseed"]

Definition at line 80 of file vsrandom.py.

float _e = 2.7182818284590451

Definition at line 76 of file vsrandom.py.

tuple _inst = Random()

Definition at line 639 of file vsrandom.py.

float _pi = 3.1415926536

Definition at line 75 of file vsrandom.py.

_seed

Definition at line 152 of file vsrandom.py.

betavariate = _inst.betavariate

Definition at line 655 of file vsrandom.py.

choice = _inst.choice

Definition at line 644 of file vsrandom.py.

cunifvariate = _inst.cunifvariate

Definition at line 649 of file vsrandom.py.

expovariate = _inst.expovariate

Definition at line 650 of file vsrandom.py.

gammavariate = _inst.gammavariate

Definition at line 652 of file vsrandom.py.

gauss = _inst.gauss

Definition at line 654 of file vsrandom.py.

gauss_next

Definition at line 193 of file vsrandom.py.

getstate = _inst.getstate

Definition at line 658 of file vsrandom.py.

jumpahead = _inst.jumpahead

Definition at line 660 of file vsrandom.py.

tuple LOG4 = _log(4.0)

Definition at line 98 of file vsrandom.py.

lognormvariate = _inst.lognormvariate

Definition at line 648 of file vsrandom.py.

normalvariate = _inst.normalvariate

Definition at line 647 of file vsrandom.py.

int NV_MAGICCONST = 4

Definition at line 92 of file vsrandom.py.

paretovariate = _inst.paretovariate

Definition at line 656 of file vsrandom.py.

randint = _inst.randint

Definition at line 643 of file vsrandom.py.

random = _inst.random

Definition at line 641 of file vsrandom.py.

randrange = _inst.randrange

Definition at line 645 of file vsrandom.py.

seed = _inst.seed

Definition at line 640 of file vsrandom.py.

setstate = _inst.setstate

Definition at line 659 of file vsrandom.py.

float SG_MAGICCONST = 1.0

Definition at line 101 of file vsrandom.py.

shuffle = _inst.shuffle

Definition at line 646 of file vsrandom.py.

stdgamma = _inst.stdgamma

Definition at line 653 of file vsrandom.py.

float TWOPI = 2.0

Definition at line 95 of file vsrandom.py.

uniform = _inst.uniform

Definition at line 642 of file vsrandom.py.

vonmisesvariate = _inst.vonmisesvariate

Definition at line 651 of file vsrandom.py.

weibullvariate = _inst.weibullvariate

Definition at line 657 of file vsrandom.py.

whseed = _inst.whseed

Definition at line 661 of file vsrandom.py.