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