aivika-1.1: A multi-paradigm simulation library

Stabilityexperimental
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Safe HaskellSafe-Inferred

Simulation.Aivika.Stream.Random

Contents

Description

Tested with: GHC 7.6.3

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

Synopsis

Stream of Random Events

randomStream :: Parameter Double -> Stream ArrivalSource

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

randomUniformStreamSource

Arguments

:: Double

the minimum delay

-> Double

the maximum delay

-> Stream Arrival

the stream of random events

Create a new stream with delays distributed uniformly.

randomNormalStreamSource

Arguments

:: Double

the mean delay

-> Double

the delay deviation

-> Stream Arrival

the stream of random events

Create a new stream with delays distributed normally.

randomExponentialStreamSource

Arguments

:: Double

the mean delay (the reciprocal of the rate)

-> Stream Arrival

the stream of random events

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

randomErlangStreamSource

Arguments

:: Double

the scale (the reciprocal of the rate)

-> Int

the shape

-> Stream Arrival

the stream of random events

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

randomPoissonStreamSource

Arguments

:: Double

the mean delay

-> Stream Arrival

the stream of random events

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

randomBinomialStreamSource

Arguments

:: Double

the probability

-> Int

the number of trials

-> Stream Arrival

the stream of random events

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