Copyright | Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
Tested with: GHC 8.0.1
Below is defined a type class of the random number generator.
- data Generator = Generator {
- generateUniform :: Double -> Double -> IO Double
- generateUniformInt :: Int -> Int -> IO Int
- generateTriangular :: Double -> Double -> Double -> IO Double
- generateNormal :: Double -> Double -> IO Double
- generateLogNormal :: Double -> Double -> IO Double
- generateExponential :: Double -> IO Double
- generateErlang :: Double -> Int -> IO Double
- generatePoisson :: Double -> IO Int
- generateBinomial :: Double -> Int -> IO Int
- generateGamma :: Double -> Double -> IO Double
- generateBeta :: Double -> Double -> IO Double
- generateWeibull :: Double -> Double -> IO Double
- generateDiscrete :: forall a. DiscretePDF a -> IO a
- data GeneratorType
- type DiscretePDF a = [(a, Double)]
- newGenerator :: GeneratorType -> IO Generator
- newRandomGenerator :: RandomGen g => g -> IO Generator
- newRandomGenerator01 :: IO Double -> 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. |
type DiscretePDF a = [(a, Double)] Source #
A discrete probability density function.
newGenerator :: GeneratorType -> IO Generator Source #
Create a new random number generator by the specified type.