Class Index | File Index

Classes


Namespace util.random

Module to emulate some of Python's random library.
Defined in: <js/util/random.js>.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
util.random.gauss(mu, sigma)
Returns a random number from an approximately Gaussian distribution.
<static>  
util.random.randInt(a, b)
Choose a random integer from [a, b]
<static>  
util.random.shuffle(list)
Shuffles a list in place, returning nothing.
<static>  
util.random.uniform(a, b)
Get a random number selected from a uniform distribution.
Namespace Detail
util.random
Method Detail
<static> {number} util.random.gauss(mu, sigma)
Returns a random number from an approximately Gaussian distribution. See: http://www.protonfish.com/random.shtml
Parameters:
{number} mu
Mean (default: 0).
{number} sigma
Standard deviation (default: 1).
Returns:
{number} Random number from Gaussian distribution.

<static> {number} util.random.randInt(a, b)
Choose a random integer from [a, b]
Parameters:
{number} a
Minimum integer that can be returned.
{number} b
Maximum integer that can be returned.
Returns:
{number} Random integer between a and b.

<static> util.random.shuffle(list)
Shuffles a list in place, returning nothing.
Parameters:
{array} list
List to be shuffled in place.

<static> {number} util.random.uniform(a, b)
Get a random number selected from a uniform distribution.
Parameters:
{number} a
Minimum number that can be returned.
{number} b
Maximum number that can be returned.
Returns:
{number} Random number from uniform distribution.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Mar 01 2013 11:45:19 GMT-0500 (EST)