aivika-1.3: A multi-paradigm simulation library

CopyrightCopyright (c) 2009-2013, David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell98

Simulation.Aivika.Generator

Description

Tested with: GHC 7.6.3

Below is defined a type class of the random number generator.

Synopsis

Documentation

data Generator Source

Defines a random number generator.

Constructors

Generator 

Fields

generatorUniform :: Double -> Double -> IO Double

Generate an uniform random number with the specified minimum and maximum.

generatorNormal :: Double -> Double -> IO Double

Generate the normal random number with the specified mean and deviation.

generatorExponential :: Double -> IO Double

Generate the random number distributed exponentially with the specified mean (the reciprocal of the rate).

generatorErlang :: Double -> Int -> IO Double

Generate the Erlang random number with the specified scale (the reciprocal of the rate) and integer shape.

generatorPoisson :: Double -> IO Int

Generate the Poisson random number with the specified mean.

generatorBinomial :: Double -> Int -> IO Int

Generate the binomial random number with the specified probability and number of trials.

data GeneratorType Source

Defines a type of the random number generator.

Constructors

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.

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.