Random

Mersenne Twister

Generates high quality pseudo random integers with a long period. Used as the default random number generator for several languages (including Python).

For a more technical overview, see the wikipedia entry.

Pseudocode: http://en.wikipedia.org/wiki/Mersenne_twister

class algorithms.random.mersenne_twister.MersenneTwister[source]
generate()[source]

Generates 624 random numbers and stores in the state list.

randint()[source]

Extracts a random number.

Return type:A random integer
seed(seed)[source]

Initialize generator.

Parameters:seed – An integer value to seed the generator with