| Copyright | Copyright (c) 2009-2017 David Sorokin <david.sorokin@gmail.com> |
|---|---|
| License | BSD3 |
| Maintainer | David Sorokin <david.sorokin@gmail.com> |
| Stability | experimental |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Simulation.Aivika.Stream.Random
Contents
Description
Tested with: GHC 8.0.1
This module defines random streams of events, which are useful for describing the input of the model.
Synopsis
- randomStream :: Parameter (Double, a) -> Stream (Arrival a)
- randomUniformStream :: Double -> Double -> Stream (Arrival Double)
- randomUniformIntStream :: Int -> Int -> Stream (Arrival Int)
- randomTriangularStream :: Double -> Double -> Double -> Stream (Arrival Double)
- randomNormalStream :: Double -> Double -> Stream (Arrival Double)
- randomLogNormalStream :: Double -> Double -> Stream (Arrival Double)
- randomExponentialStream :: Double -> Stream (Arrival Double)
- randomErlangStream :: Double -> Int -> Stream (Arrival Double)
- randomPoissonStream :: Double -> Stream (Arrival Int)
- randomBinomialStream :: Double -> Int -> Stream (Arrival Int)
- randomGammaStream :: Double -> Double -> Stream (Arrival Double)
- randomBetaStream :: Double -> Double -> Stream (Arrival Double)
- randomWeibullStream :: Double -> Double -> Stream (Arrival Double)
- randomDiscreteStream :: DiscretePDF Double -> Stream (Arrival Double)
Stream of Random Events
Arguments
| :: Parameter (Double, a) | compute a pair of the delay and event of type |
| -> Stream (Arrival a) | a stream of delayed events |
Return a stream of random events that arrive with the specified delay.
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 random 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 random delays distributed uniformly.
randomTriangularStream Source #
Arguments
| :: Double | the minimum delay |
| -> Double | the median of the delay |
| -> Double | the maximum delay |
| -> Stream (Arrival Double) | the stream of random events with the delays generated |
Create a new stream with random delays having the triangular distribution.
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 random delays distributed normally.
randomLogNormalStream Source #
Arguments
| :: Double | the mean of a normal distribution which this distribution is derived from |
| -> Double | the deviation of a normal distribution which this distribution is derived from |
| -> Stream (Arrival Double) | the stream of random events with the delays generated |
Create a new stream with random delays having the lognormal distribution.
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 random delays distibuted exponentially with the specified mean (the reciprocal of the rate).
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 random delays having the Erlang distribution with the specified scale (the reciprocal of the rate) and shape parameters.
Arguments
| :: Double | the mean delay |
| -> Stream (Arrival Int) | the stream of random events with the delays generated |
Return a new stream with random delays having the Poisson distribution with the specified mean.
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 random delays having the binomial distribution with the specified probability and trials.
Arguments
| :: Double | the shape |
| -> Double | the scale (a reciprocal of the rate) |
| -> Stream (Arrival Double) | the stream of random events with the delays generated |
Return a new stream with random delays having the Gamma distribution by the specified shape and scale.
Arguments
| :: Double | the shape (alpha) |
| -> Double | the shape (beta) |
| -> Stream (Arrival Double) | the stream of random events with the delays generated |
Return a new stream with random delays having the Beta distribution by the specified shape parameters (alpha and beta).
Arguments
| :: Double | shape |
| -> Double | scale |
| -> Stream (Arrival Double) | the stream of random events with the delays generated |
Return a new stream with random delays having the Weibull distribution by the specified shape and scale.
Arguments
| :: DiscretePDF Double | the discrete probability density function |
| -> Stream (Arrival Double) | the stream of random events with the delays generated |
Return a new stream with random delays having the specified discrete distribution.