Class Index | File Index

Classes


Namespace ROT.RNG

This code is an implementation of Alea algorithm; (C) 2010 Johannes Baag√łe. Alea is licensed according to the http://en.wikipedia.org/wiki/MIT_License.
Defined in: <rot.js>.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
ROT.RNG.getNormal(mean, stddev)
<static>  
ROT.RNG.getPercentage()
<static>  
ROT.RNG.getSeed()
<static>  
ROT.RNG.getState()
Get RNG state.
<static>  
ROT.RNG.getUniform()
<static>  
ROT.RNG.getWeightedValue(data)
<static>  
ROT.RNG.setSeed(seed)
<static>  
ROT.RNG.setState(state)
Set a previously retrieved state.
Namespace Detail
ROT.RNG
Method Detail
<static> {float} ROT.RNG.getNormal(mean, stddev)
Parameters:
{float} mean Optional, Default: 0
Mean value
{float} stddev Optional, Default: 1
Standard deviation. ~95% of the absolute values will be lower than 2*stddev.
Returns:
{float} A normally distributed pseudorandom value

<static> {int} ROT.RNG.getPercentage()
Returns:
{int} Pseudorandom value [1,100] inclusive, uniformly distributed

<static> {number} ROT.RNG.getSeed()
Returns:
{number}

<static> {?} ROT.RNG.getState()
Get RNG state. Useful for storing the state and re-setting it via setState.
Returns:
{?} Internal state

<static> {float} ROT.RNG.getUniform()
Returns:
{float} Pseudorandom value [0,1), uniformly distributed

<static> {string} ROT.RNG.getWeightedValue(data)
Parameters:
{object} data
key=whatever, value=weight (relative probability)
Returns:
{string} whatever

<static> ROT.RNG.setSeed(seed)
Parameters:
{number} seed
Seed the number generator

<static> ROT.RNG.setState(state)
Set a previously retrieved state.
Parameters:
{?} state

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Mar 08 2013 11:07:30 GMT+0100 (CET)