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 some useful predefined activities that hold the current process for the corresponding random time interval, when processing every input element.

## Synopsis

- newRandomUniformActivity :: Double -> Double -> Simulation (Activity () a a)
- newRandomUniformIntActivity :: Int -> Int -> Simulation (Activity () a a)
- newRandomTriangularActivity :: Double -> Double -> Double -> Simulation (Activity () a a)
- newRandomNormalActivity :: Double -> Double -> Simulation (Activity () a a)
- newRandomLogNormalActivity :: Double -> Double -> Simulation (Activity () a a)
- newRandomExponentialActivity :: Double -> Simulation (Activity () a a)
- newRandomErlangActivity :: Double -> Int -> Simulation (Activity () a a)
- newRandomPoissonActivity :: Double -> Simulation (Activity () a a)
- newRandomBinomialActivity :: Double -> Int -> Simulation (Activity () a a)
- newRandomGammaActivity :: Double -> Double -> Simulation (Activity () a a)
- newRandomBetaActivity :: Double -> Double -> Simulation (Activity () a a)
- newRandomWeibullActivity :: Double -> Double -> Simulation (Activity () a a)
- newRandomDiscreteActivity :: DiscretePDF Double -> Simulation (Activity () a a)
- newPreemptibleRandomUniformActivity :: Bool -> Double -> Double -> Simulation (Activity () a a)
- newPreemptibleRandomUniformIntActivity :: Bool -> Int -> Int -> Simulation (Activity () a a)
- newPreemptibleRandomTriangularActivity :: Bool -> Double -> Double -> Double -> Simulation (Activity () a a)
- newPreemptibleRandomNormalActivity :: Bool -> Double -> Double -> Simulation (Activity () a a)
- newPreemptibleRandomLogNormalActivity :: Bool -> Double -> Double -> Simulation (Activity () a a)
- newPreemptibleRandomExponentialActivity :: Bool -> Double -> Simulation (Activity () a a)
- newPreemptibleRandomErlangActivity :: Bool -> Double -> Int -> Simulation (Activity () a a)
- newPreemptibleRandomPoissonActivity :: Bool -> Double -> Simulation (Activity () a a)
- newPreemptibleRandomBinomialActivity :: Bool -> Double -> Int -> Simulation (Activity () a a)
- newPreemptibleRandomGammaActivity :: Bool -> Double -> Double -> Simulation (Activity () a a)
- newPreemptibleRandomBetaActivity :: Bool -> Double -> Double -> Simulation (Activity () a a)
- newPreemptibleRandomWeibullActivity :: Bool -> Double -> Double -> Simulation (Activity () a a)
- newPreemptibleRandomDiscreteActivity :: Bool -> DiscretePDF Double -> Simulation (Activity () a a)

# Documentation

newRandomUniformActivity Source #

:: Double | the minimum time interval |

-> Double | the maximum time interval |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval distributed uniformly, when processing every input element.

By default, it is assumed that the activity process cannot be preempted, because the handling of possible task preemption is rather costly operation.

newRandomUniformIntActivity Source #

:: Int | the minimum time interval |

-> Int | the maximum time interval |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval distributed uniformly, when processing every input element.

By default, it is assumed that the activity process cannot be preempted, because the handling of possible task preemption is rather costly operation.

newRandomTriangularActivity Source #

:: Double | the minimum time interval |

-> Double | the median of the time interval |

-> Double | the maximum time interval |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the triangular distribution, when processing every input element.

By default, it is assumed that the activity process cannot be preempted, because the handling of possible task preemption is rather costly operation.

newRandomNormalActivity Source #

:: Double | the mean time interval |

-> Double | the time interval deviation |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval distributed normally, when processing every input element.

newRandomLogNormalActivity Source #

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

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the lognormal distribution, when processing every input element.

newRandomExponentialActivity Source #

:: Double | the mean time interval (the reciprocal of the rate) |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval distributed exponentially with the specified mean (the reciprocal of the rate), when processing every input element.

newRandomErlangActivity Source #

:: Double | the scale (the reciprocal of the rate) |

-> Int | the shape |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Erlang distribution with the specified scale (the reciprocal of the rate) and shape parameters, when processing every input element.

newRandomPoissonActivity Source #

:: Double | the mean time interval |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Poisson distribution with the specified mean, when processing every input element.

newRandomBinomialActivity Source #

:: Double | the probability |

-> Int | the number of trials |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the binomial distribution with the specified probability and trials, when processing every input element.

newRandomGammaActivity Source #

:: Double | the shape |

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

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Gamma distribution with the specified shape and scale, when processing every input element.

newRandomBetaActivity Source #

:: Double | shape (alpha) |

-> Double | shape (beta) |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Beta distribution with the specified shape parameters (alpha and beta), when processing every input element.

newRandomWeibullActivity Source #

:: Double | shape |

-> Double | scale |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Weibull distribution with the specified shape and scale, when processing every input element.

newRandomDiscreteActivity Source #

:: DiscretePDF Double | the discrete probability density function |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the specified discrete distribution, when processing every input element.

newPreemptibleRandomUniformActivity Source #

:: Bool | whether the activity process can be preempted |

-> Double | the minimum time interval |

-> Double | the maximum time interval |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval distributed uniformly, when processing every input element.

newPreemptibleRandomUniformIntActivity Source #

:: Bool | whether the activity process can be preempted |

-> Int | the minimum time interval |

-> Int | the maximum time interval |

-> Simulation (Activity () a a) |

newPreemptibleRandomTriangularActivity Source #

:: Bool | whether the activity process can be preempted |

-> Double | the minimum time interval |

-> Double | the median of the time interval |

-> Double | the maximum time interval |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the triangular distribution, when processing every input element.

newPreemptibleRandomNormalActivity Source #

:: Bool | whether the activity process can be preempted |

-> Double | the mean time interval |

-> Double | the time interval deviation |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval distributed normally, when processing every input element.

newPreemptibleRandomLogNormalActivity Source #

:: Bool | whether the activity process can be preempted |

-> 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 |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the lognormal distribution, when processing every input element.

newPreemptibleRandomExponentialActivity Source #

:: Bool | whether the activity process can be preempted |

-> Double | the mean time interval (the reciprocal of the rate) |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval distributed exponentially with the specified mean (the reciprocal of the rate), when processing every input element.

newPreemptibleRandomErlangActivity Source #

:: Bool | whether the activity process can be preempted |

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

-> Int | the shape |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Erlang distribution with the specified scale (the reciprocal of the rate) and shape parameters, when processing every input element.

newPreemptibleRandomPoissonActivity Source #

:: Bool | whether the activity process can be preempted |

-> Double | the mean time interval |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Poisson distribution with the specified mean, when processing every input element.

newPreemptibleRandomBinomialActivity Source #

:: Bool | whether the activity process can be preempted |

-> Double | the probability |

-> Int | the number of trials |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the binomial distribution with the specified probability and trials, when processing every input element.

newPreemptibleRandomGammaActivity Source #

:: Bool | whether the activity process can be preempted |

-> Double | the shape |

-> Double | the scale |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Gamma distribution with the specified shape and scale, when processing every input element.

newPreemptibleRandomBetaActivity Source #

:: Bool | whether the activity process can be preempted |

-> Double | shape (alpha) |

-> Double | shape (beta) |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Beta distribution with the specified shape parameters (alpha and beta), when processing every input element.

newPreemptibleRandomWeibullActivity Source #

:: Bool | whether the activity process can be preempted |

-> Double | shape |

-> Double | scale |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the Weibull distribution with the specified shape and scale, when processing every input element.

newPreemptibleRandomDiscreteActivity Source #

:: Bool | whether the activity process can be preempted |

-> DiscretePDF Double | the discrete probability density function |

-> Simulation (Activity () a a) |

Create a new activity that holds the process for a random time interval having the specified discrete distribution, when processing every input element.