Copyright | Copyright (c) 2009-2017 David Sorokin <david.sorokin@gmail.com> |
---|---|

License | BSD3 |

Maintainer | David Sorokin <david.sorokin@gmail.com> |

Stability | experimental |

Safe Haskell | None |

Language | Haskell2010 |

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 :: MonadDES m => Parameter m (Double, a) -> Stream m (Arrival a)
- randomUniformStream :: MonadDES m => Double -> Double -> Stream m (Arrival Double)
- randomUniformIntStream :: MonadDES m => Int -> Int -> Stream m (Arrival Int)
- randomTriangularStream :: MonadDES m => Double -> Double -> Double -> Stream m (Arrival Double)
- randomNormalStream :: MonadDES m => Double -> Double -> Stream m (Arrival Double)
- randomLogNormalStream :: MonadDES m => Double -> Double -> Stream m (Arrival Double)
- randomExponentialStream :: MonadDES m => Double -> Stream m (Arrival Double)
- randomErlangStream :: MonadDES m => Double -> Int -> Stream m (Arrival Double)
- randomPoissonStream :: MonadDES m => Double -> Stream m (Arrival Int)
- randomBinomialStream :: MonadDES m => Double -> Int -> Stream m (Arrival Int)
- randomGammaStream :: MonadDES m => Double -> Double -> Stream m (Arrival Double)
- randomBetaStream :: MonadDES m => Double -> Double -> Stream m (Arrival Double)
- randomWeibullStream :: MonadDES m => Double -> Double -> Stream m (Arrival Double)
- randomDiscreteStream :: MonadDES m => DiscretePDF Double -> Stream m (Arrival Double)

# Stream of Random Events

:: MonadDES m | |

=> Parameter m (Double, a) | compute a pair of the delay and event of type |

-> Stream m (Arrival a) | a stream of delayed events |

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

:: MonadDES m | |

=> Double | the minimum delay |

-> Double | the maximum delay |

-> Stream m (Arrival Double) | the stream of random events with the delays generated |

Create a new stream with delays distributed uniformly.

randomUniformIntStream Source #

:: MonadDES m | |

=> Int | the minimum delay |

-> Int | the maximum delay |

-> Stream m (Arrival Int) | the stream of random events with the delays generated |

Create a new stream with integer delays distributed uniformly.

randomTriangularStream Source #

:: MonadDES m | |

=> Double | the minimum delay |

-> Double | the median of the delay |

-> Double | the maximum delay |

-> Stream m (Arrival Double) | the stream of random events with the delays generated |

Create a new stream with random delays having the triangular distribution.

:: MonadDES m | |

=> Double | the mean delay |

-> Double | the delay deviation |

-> Stream m (Arrival Double) | the stream of random events with the delays generated |

Create a new stream with delays distributed normally.

randomLogNormalStream Source #

:: MonadDES m | |

=> 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 m (Arrival Double) | the stream of random events with the delays generated |

Create a new stream with random delays having the lognormal distribution.

randomExponentialStream Source #

:: MonadDES m | |

=> Double | the mean delay (the reciprocal of the rate) |

-> Stream m (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).

:: MonadDES m | |

=> Double | the scale (the reciprocal of the rate) |

-> Int | the shape |

-> Stream m (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.

:: MonadDES m | |

=> Double | the mean delay |

-> Stream m (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.

:: MonadDES m | |

=> Double | the probability |

-> Int | the number of trials |

-> Stream m (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.

:: MonadDES m | |

=> Double | the shape |

-> Double | the scale (a reciprocal of the rate) |

-> Stream m (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.

:: MonadDES m | |

=> Double | the shape (alpha) |

-> Double | the shape (beta) |

-> Stream m (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).

:: MonadDES m | |

=> Double | shape |

-> Double | scale |

-> Stream m (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.