aivika-4.1: A multi-paradigm simulation library

CopyrightCopyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Simulation.Aivika.Stream.Random

Contents

Description

Tested with: GHC 7.10.1

This module defines random streams of events, which are useful for describing the input of the model.

Synopsis

Stream of Random Events

randomStream Source

Arguments

:: Parameter (Double, a)

compute a pair of the delay and event of type a

-> Stream (Arrival a)

a stream of delayed events

Return a sream of random events that arrive with the specified delay.

randomUniformStream Source

Arguments

:: Double

the minimum delay

-> Double

the maximum delay

-> Stream (Arrival Double)

the stream of random events with the delays generated

Create a new stream with delays distributed uniformly.

randomUniformIntStream Source

Arguments

:: Int

the minimum delay

-> Int

the maximum delay

-> Stream (Arrival Int)

the stream of random events with the delays generated

Create a new stream with integer delays distributed uniformly.

randomNormalStream Source

Arguments

:: Double

the mean delay

-> Double

the delay deviation

-> Stream (Arrival Double)

the stream of random events with the delays generated

Create a new stream with delays distributed normally.

randomExponentialStream Source

Arguments

:: Double

the mean delay (the reciprocal of the rate)

-> Stream (Arrival Double)

the stream of random events with the delays generated

Return a new stream with delays distibuted exponentially with the specified mean (the reciprocal of the rate).

randomErlangStream Source

Arguments

:: Double

the scale (the reciprocal of the rate)

-> Int

the shape

-> Stream (Arrival Double)

the stream of random events with the delays generated

Return a new stream with delays having the Erlang distribution with the specified scale (the reciprocal of the rate) and shape parameters.

randomPoissonStream Source

Arguments

:: Double

the mean delay

-> Stream (Arrival Int)

the stream of random events with the delays generated

Return a new stream with delays having the Poisson distribution with the specified mean.

randomBinomialStream Source

Arguments

:: Double

the probability

-> Int

the number of trials

-> Stream (Arrival Int)

the stream of random events with the delays generated

Return a new stream with delays having the binomial distribution with the specified probability and trials.