Copyright | Copyright (c) 2009-2014, 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 7.8.3

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

- randomStream :: MonadComp m => Parameter m (Double, a) -> Stream m (Arrival a)
- randomUniformStream :: MonadComp m => Double -> Double -> Stream m (Arrival Double)
- randomUniformIntStream :: MonadComp m => Int -> Int -> Stream m (Arrival Int)
- randomNormalStream :: MonadComp m => Double -> Double -> Stream m (Arrival Double)
- randomExponentialStream :: MonadComp m => Double -> Stream m (Arrival Double)
- randomErlangStream :: MonadComp m => Double -> Int -> Stream m (Arrival Double)
- randomPoissonStream :: MonadComp m => Double -> Stream m (Arrival Int)
- randomBinomialStream :: MonadComp m => Double -> Int -> Stream m (Arrival Int)

# Stream of Random Events

:: MonadComp 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 sream of random events that arrive with the specified delay.

:: MonadComp 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.

:: MonadComp 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.

:: MonadComp 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.

randomExponentialStream Source

:: MonadComp 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).

:: MonadComp 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.