Copyright | Copyright (c) 2009-2014, 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 {
- generateUniform :: Double -> Double -> IO Double
- generateUniformInt :: Int -> Int -> IO Int
- generateNormal :: Double -> Double -> IO Double
- generateExponential :: Double -> IO Double
- generateErlang :: Double -> Int -> IO Double
- generatePoisson :: Double -> IO Int
- generateBinomial :: 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.