module Simulation.Aivika.Trans.Activity.Random
(newRandomUniformActivity,
newRandomUniformIntActivity,
newRandomTriangularActivity,
newRandomNormalActivity,
newRandomLogNormalActivity,
newRandomExponentialActivity,
newRandomErlangActivity,
newRandomPoissonActivity,
newRandomBinomialActivity,
newRandomGammaActivity,
newRandomBetaActivity,
newRandomWeibullActivity,
newRandomDiscreteActivity,
newPreemptibleRandomUniformActivity,
newPreemptibleRandomUniformIntActivity,
newPreemptibleRandomTriangularActivity,
newPreemptibleRandomNormalActivity,
newPreemptibleRandomLogNormalActivity,
newPreemptibleRandomExponentialActivity,
newPreemptibleRandomErlangActivity,
newPreemptibleRandomPoissonActivity,
newPreemptibleRandomBinomialActivity,
newPreemptibleRandomGammaActivity,
newPreemptibleRandomBetaActivity,
newPreemptibleRandomWeibullActivity,
newPreemptibleRandomDiscreteActivity) where
import Simulation.Aivika.Trans.DES
import Simulation.Aivika.Trans.Generator
import Simulation.Aivika.Trans.Simulation
import Simulation.Aivika.Trans.Process
import Simulation.Aivika.Trans.Process.Random
import Simulation.Aivika.Trans.Activity
newRandomUniformActivity :: MonadDES m
=> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomUniformActivity #-}
newRandomUniformActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Activity m () a a)
newRandomUniformActivity =
Bool -> Double -> Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomUniformActivity Bool
False
newRandomUniformIntActivity :: MonadDES m
=> Int
-> Int
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomUniformIntActivity #-}
newRandomUniformIntActivity :: forall (m :: * -> *) a.
MonadDES m =>
Int -> Int -> Simulation m (Activity m () a a)
newRandomUniformIntActivity =
Bool -> Int -> Int -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Int -> Int -> Simulation m (Activity m () a a)
newPreemptibleRandomUniformIntActivity Bool
False
newRandomTriangularActivity :: MonadDES m
=> Double
-> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomTriangularActivity #-}
newRandomTriangularActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Double -> Simulation m (Activity m () a a)
newRandomTriangularActivity =
Bool
-> Double -> Double -> Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool
-> Double -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomTriangularActivity Bool
False
newRandomNormalActivity :: MonadDES m
=> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomNormalActivity #-}
newRandomNormalActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Activity m () a a)
newRandomNormalActivity =
Bool -> Double -> Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomNormalActivity Bool
False
newRandomLogNormalActivity :: MonadDES m
=> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomLogNormalActivity #-}
newRandomLogNormalActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Activity m () a a)
newRandomLogNormalActivity =
Bool -> Double -> Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomLogNormalActivity Bool
False
newRandomExponentialActivity :: MonadDES m
=> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomExponentialActivity #-}
newRandomExponentialActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Simulation m (Activity m () a a)
newRandomExponentialActivity =
Bool -> Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomExponentialActivity Bool
False
newRandomErlangActivity :: MonadDES m
=> Double
-> Int
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomErlangActivity #-}
newRandomErlangActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Int -> Simulation m (Activity m () a a)
newRandomErlangActivity =
Bool -> Double -> Int -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Simulation m (Activity m () a a)
newPreemptibleRandomErlangActivity Bool
False
newRandomPoissonActivity :: MonadDES m
=> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomPoissonActivity #-}
newRandomPoissonActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Simulation m (Activity m () a a)
newRandomPoissonActivity =
Bool -> Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomPoissonActivity Bool
False
newRandomBinomialActivity :: MonadDES m
=> Double
-> Int
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomBinomialActivity #-}
newRandomBinomialActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Int -> Simulation m (Activity m () a a)
newRandomBinomialActivity =
Bool -> Double -> Int -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Simulation m (Activity m () a a)
newPreemptibleRandomBinomialActivity Bool
False
newRandomGammaActivity :: MonadDES m
=> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomGammaActivity #-}
newRandomGammaActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Activity m () a a)
newRandomGammaActivity =
Bool -> Double -> Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomGammaActivity Bool
False
newRandomBetaActivity :: MonadDES m
=> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomBetaActivity #-}
newRandomBetaActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Activity m () a a)
newRandomBetaActivity =
Bool -> Double -> Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomBetaActivity Bool
False
newRandomWeibullActivity :: MonadDES m
=> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomWeibullActivity #-}
newRandomWeibullActivity :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Activity m () a a)
newRandomWeibullActivity =
Bool -> Double -> Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomWeibullActivity Bool
False
newRandomDiscreteActivity :: MonadDES m
=> DiscretePDF Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newRandomDiscreteActivity #-}
newRandomDiscreteActivity :: forall (m :: * -> *) a.
MonadDES m =>
DiscretePDF Double -> Simulation m (Activity m () a a)
newRandomDiscreteActivity =
Bool -> DiscretePDF Double -> Simulation m (Activity m () a a)
forall (m :: * -> *) a.
MonadDES m =>
Bool -> DiscretePDF Double -> Simulation m (Activity m () a a)
newPreemptibleRandomDiscreteActivity Bool
False
newPreemptibleRandomUniformActivity :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomUniformActivity #-}
newPreemptibleRandomUniformActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomUniformActivity Bool
preemptible Double
min Double
max =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomUniformProcess_ Double
min Double
max
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomUniformIntActivity :: MonadDES m
=> Bool
-> Int
-> Int
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomUniformIntActivity #-}
newPreemptibleRandomUniformIntActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Int -> Int -> Simulation m (Activity m () a a)
newPreemptibleRandomUniformIntActivity Bool
preemptible Int
min Int
max =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Int -> Int -> Process m ()
forall (m :: * -> *). MonadDES m => Int -> Int -> Process m ()
randomUniformIntProcess_ Int
min Int
max
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomTriangularActivity :: MonadDES m
=> Bool
-> Double
-> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomTriangularActivity #-}
newPreemptibleRandomTriangularActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool
-> Double -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomTriangularActivity Bool
preemptible Double
min Double
median Double
max =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Double -> Process m ()
randomTriangularProcess_ Double
min Double
median Double
max
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomNormalActivity :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomNormalActivity #-}
newPreemptibleRandomNormalActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomNormalActivity Bool
preemptible Double
mu Double
nu =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomNormalProcess_ Double
mu Double
nu
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomLogNormalActivity :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomLogNormalActivity #-}
newPreemptibleRandomLogNormalActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomLogNormalActivity Bool
preemptible Double
mu Double
nu =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomLogNormalProcess_ Double
mu Double
nu
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomExponentialActivity :: MonadDES m
=> Bool
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomExponentialActivity #-}
newPreemptibleRandomExponentialActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomExponentialActivity Bool
preemptible Double
mu =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Process m ()
forall (m :: * -> *). MonadDES m => Double -> Process m ()
randomExponentialProcess_ Double
mu
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomErlangActivity :: MonadDES m
=> Bool
-> Double
-> Int
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomErlangActivity #-}
newPreemptibleRandomErlangActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Simulation m (Activity m () a a)
newPreemptibleRandomErlangActivity Bool
preemptible Double
beta Int
m =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Int -> Process m ()
forall (m :: * -> *). MonadDES m => Double -> Int -> Process m ()
randomErlangProcess_ Double
beta Int
m
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomPoissonActivity :: MonadDES m
=> Bool
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomPoissonActivity #-}
newPreemptibleRandomPoissonActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomPoissonActivity Bool
preemptible Double
mu =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Process m ()
forall (m :: * -> *). MonadDES m => Double -> Process m ()
randomPoissonProcess_ Double
mu
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomBinomialActivity :: MonadDES m
=> Bool
-> Double
-> Int
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomBinomialActivity #-}
newPreemptibleRandomBinomialActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Simulation m (Activity m () a a)
newPreemptibleRandomBinomialActivity Bool
preemptible Double
prob Int
trials =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Int -> Process m ()
forall (m :: * -> *). MonadDES m => Double -> Int -> Process m ()
randomBinomialProcess_ Double
prob Int
trials
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomGammaActivity :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomGammaActivity #-}
newPreemptibleRandomGammaActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomGammaActivity Bool
preemptible Double
kappa Double
theta =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomGammaProcess_ Double
kappa Double
theta
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomBetaActivity :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomBetaActivity #-}
newPreemptibleRandomBetaActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomBetaActivity Bool
preemptible Double
alpha Double
beta =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomBetaProcess_ Double
alpha Double
beta
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomWeibullActivity :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomWeibullActivity #-}
newPreemptibleRandomWeibullActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Activity m () a a)
newPreemptibleRandomWeibullActivity Bool
preemptible Double
alpha Double
beta =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomWeibullProcess_ Double
alpha Double
beta
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomDiscreteActivity :: MonadDES m
=> Bool
-> DiscretePDF Double
-> Simulation m (Activity m () a a)
{-# INLINABLE newPreemptibleRandomDiscreteActivity #-}
newPreemptibleRandomDiscreteActivity :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> DiscretePDF Double -> Simulation m (Activity m () a a)
newPreemptibleRandomDiscreteActivity Bool
preemptible DiscretePDF Double
dpdf =
Bool -> (a -> Process m a) -> Simulation m (Activity m () a a)
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Activity m () a b)
newPreemptibleActivity Bool
preemptible ((a -> Process m a) -> Simulation m (Activity m () a a))
-> (a -> Process m a) -> Simulation m (Activity m () a a)
forall a b. (a -> b) -> a -> b
$ \a
a ->
do DiscretePDF Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
DiscretePDF Double -> Process m ()
randomDiscreteProcess_ DiscretePDF Double
dpdf
a -> Process m a
forall a. a -> Process m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a