Copyright | Copyright (c) 2009-2013, David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Tested with: GHC 7.8.3
Below is defined a type class of the random number generator.
- data Generator = Generator {
- generatorUniform :: Double -> Double -> IO Double
- generatorUniformInt :: Int -> Int -> IO Int
- generatorNormal :: Double -> Double -> IO Double
- generatorExponential :: Double -> IO Double
- generatorErlang :: Double -> Int -> IO Double
- generatorPoisson :: Double -> IO Int
- generatorBinomial :: Double -> Int -> IO Int
- data GeneratorType
- newGenerator :: GeneratorType -> IO Generator
- newRandomGenerator :: RandomGen g => g -> IO Generator
Documentation
Defines a random number generator.
Generator | |
|
data GeneratorType Source
Defines a type of the random number generator.
SimpleGenerator | The simple random number generator. |
SimpleGeneratorWithSeed Int | The simple random number generator with the specified seed. |
CustomGenerator (IO Generator) | The custom random number generator. |
CustomGenerator01 (IO Double) | The custom random number generator by the specified uniform generator of numbers from 0 to 1. |
newGenerator :: GeneratorType -> IO Generator Source
Create a new random number generator by the specified type.
newRandomGenerator :: RandomGen g => g -> IO Generator Source
Create a new random generator by the specified standard generator.