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 :: MonadDES m => Double -> Double -> Simulation m (Activity m () a a)
- newRandomUniformIntActivity :: MonadDES m => Int -> Int -> Simulation m (Activity m () a a)
- newRandomTriangularActivity :: MonadDES m => Double -> Double -> Double -> Simulation m (Activity m () a a)
- newRandomNormalActivity :: MonadDES m => Double -> Double -> Simulation m (Activity m () a a)
- newRandomLogNormalActivity :: MonadDES m => Double -> Double -> Simulation m (Activity m () a a)
- newRandomExponentialActivity :: MonadDES m => Double -> Simulation m (Activity m () a a)
- newRandomErlangActivity :: MonadDES m => Double -> Int -> Simulation m (Activity m () a a)
- newRandomPoissonActivity :: MonadDES m => Double -> Simulation m (Activity m () a a)
- newRandomBinomialActivity :: MonadDES m => Double -> Int -> Simulation m (Activity m () a a)
- newRandomGammaActivity :: MonadDES m => Double -> Double -> Simulation m (Activity m () a a)
- newRandomBetaActivity :: MonadDES m => Double -> Double -> Simulation m (Activity m () a a)
- newRandomWeibullActivity :: MonadDES m => Double -> Double -> Simulation m (Activity m () a a)
- newRandomDiscreteActivity :: MonadDES m => DiscretePDF Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomUniformActivity :: MonadDES m => Bool -> Double -> Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomUniformIntActivity :: MonadDES m => Bool -> Int -> Int -> Simulation m (Activity m () a a)
- newPreemptibleRandomTriangularActivity :: MonadDES m => Bool -> Double -> Double -> Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomNormalActivity :: MonadDES m => Bool -> Double -> Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomLogNormalActivity :: MonadDES m => Bool -> Double -> Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomExponentialActivity :: MonadDES m => Bool -> Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomErlangActivity :: MonadDES m => Bool -> Double -> Int -> Simulation m (Activity m () a a)
- newPreemptibleRandomPoissonActivity :: MonadDES m => Bool -> Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomBinomialActivity :: MonadDES m => Bool -> Double -> Int -> Simulation m (Activity m () a a)
- newPreemptibleRandomGammaActivity :: MonadDES m => Bool -> Double -> Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomBetaActivity :: MonadDES m => Bool -> Double -> Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomWeibullActivity :: MonadDES m => Bool -> Double -> Double -> Simulation m (Activity m () a a)
- newPreemptibleRandomDiscreteActivity :: MonadDES m => Bool -> DiscretePDF Double -> Simulation m (Activity m () a a)

# Documentation

newRandomUniformActivity Source #

:: MonadDES m | |

=> Double | the minimum time interval |

-> Double | the maximum time interval |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Int | the minimum time interval |

-> Int | the maximum time interval |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Double | the minimum time interval |

-> Double | the median of the time interval |

-> Double | the maximum time interval |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Double | the mean time interval |

-> Double | the time interval deviation |

-> Simulation m (Activity m () a a) |

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

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

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

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

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

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

-> Int | the shape |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Double | the mean time interval |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Double | the probability |

-> Int | the number of trials |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Double | the shape |

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

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Double | shape (alpha) |

-> Double | shape (beta) |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Double | shape |

-> Double | scale |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> DiscretePDF Double | the discrete probability density function |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

-> Double | the minimum time interval |

-> Double | the maximum time interval |

-> Simulation m (Activity m () a a) |

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

newPreemptibleRandomUniformIntActivity Source #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

-> Int | the minimum time interval |

-> Int | the maximum time interval |

-> Simulation m (Activity m () a a) |

newPreemptibleRandomTriangularActivity Source #

:: MonadDES m | |

=> 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 m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

-> Double | the mean time interval |

-> Double | the time interval deviation |

-> Simulation m (Activity m () a a) |

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

newPreemptibleRandomLogNormalActivity Source #

:: MonadDES m | |

=> 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 m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

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

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

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

-> Int | the shape |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

-> Double | the mean time interval |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

-> Double | the probability |

-> Int | the number of trials |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

-> Double | the shape |

-> Double | the scale |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

-> Double | shape (alpha) |

-> Double | shape (beta) |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

-> Double | shape |

-> Double | scale |

-> Simulation m (Activity m () 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 #

:: MonadDES m | |

=> Bool | whether the activity process can be preempted |

-> DiscretePDF Double | the discrete probability density function |

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