module Simulation.Aivika.Trans.Server.Random
(newRandomUniformServer,
newRandomUniformIntServer,
newRandomTriangularServer,
newRandomNormalServer,
newRandomLogNormalServer,
newRandomExponentialServer,
newRandomErlangServer,
newRandomPoissonServer,
newRandomBinomialServer,
newRandomGammaServer,
newRandomBetaServer,
newRandomWeibullServer,
newRandomDiscreteServer,
newPreemptibleRandomUniformServer,
newPreemptibleRandomUniformIntServer,
newPreemptibleRandomTriangularServer,
newPreemptibleRandomNormalServer,
newPreemptibleRandomLogNormalServer,
newPreemptibleRandomExponentialServer,
newPreemptibleRandomErlangServer,
newPreemptibleRandomPoissonServer,
newPreemptibleRandomBinomialServer,
newPreemptibleRandomGammaServer,
newPreemptibleRandomBetaServer,
newPreemptibleRandomWeibullServer,
newPreemptibleRandomDiscreteServer) 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.Server
newRandomUniformServer :: MonadDES m
=> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomUniformServer #-}
newRandomUniformServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Server m () a a)
newRandomUniformServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomUniformServer Bool
False
newRandomUniformIntServer :: MonadDES m
=> Int
-> Int
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomUniformIntServer #-}
newRandomUniformIntServer :: forall (m :: * -> *) a.
MonadDES m =>
Int -> Int -> Simulation m (Server m () a a)
newRandomUniformIntServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Int -> Int -> Simulation m (Server m () a a)
newPreemptibleRandomUniformIntServer Bool
False
newRandomTriangularServer :: MonadDES m
=> Double
-> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomTriangularServer #-}
newRandomTriangularServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Double -> Simulation m (Server m () a a)
newRandomTriangularServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool
-> Double -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomTriangularServer Bool
False
newRandomNormalServer :: MonadDES m
=> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomNormalServer #-}
newRandomNormalServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Server m () a a)
newRandomNormalServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomNormalServer Bool
False
newRandomLogNormalServer :: MonadDES m
=> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomLogNormalServer #-}
newRandomLogNormalServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Server m () a a)
newRandomLogNormalServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomLogNormalServer Bool
False
newRandomExponentialServer :: MonadDES m
=> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomExponentialServer #-}
newRandomExponentialServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Simulation m (Server m () a a)
newRandomExponentialServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomExponentialServer Bool
False
newRandomErlangServer :: MonadDES m
=> Double
-> Int
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomErlangServer #-}
newRandomErlangServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Int -> Simulation m (Server m () a a)
newRandomErlangServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Simulation m (Server m () a a)
newPreemptibleRandomErlangServer Bool
False
newRandomPoissonServer :: MonadDES m
=> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomPoissonServer #-}
newRandomPoissonServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Simulation m (Server m () a a)
newRandomPoissonServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomPoissonServer Bool
False
newRandomBinomialServer :: MonadDES m
=> Double
-> Int
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomBinomialServer #-}
newRandomBinomialServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Int -> Simulation m (Server m () a a)
newRandomBinomialServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Simulation m (Server m () a a)
newPreemptibleRandomBinomialServer Bool
False
newRandomGammaServer :: MonadDES m
=> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomGammaServer #-}
newRandomGammaServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Server m () a a)
newRandomGammaServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomGammaServer Bool
False
newRandomBetaServer :: MonadDES m
=> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomBetaServer #-}
newRandomBetaServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Server m () a a)
newRandomBetaServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomBetaServer Bool
False
newRandomWeibullServer :: MonadDES m
=> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomWeibullServer #-}
newRandomWeibullServer :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Simulation m (Server m () a a)
newRandomWeibullServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomWeibullServer Bool
False
newRandomDiscreteServer :: MonadDES m
=> DiscretePDF Double
-> Simulation m (Server m () a a)
{-# INLINABLE newRandomDiscreteServer #-}
newRandomDiscreteServer :: forall (m :: * -> *) a.
MonadDES m =>
DiscretePDF Double -> Simulation m (Server m () a a)
newRandomDiscreteServer =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> DiscretePDF Double -> Simulation m (Server m () a a)
newPreemptibleRandomDiscreteServer Bool
False
newPreemptibleRandomUniformServer :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomUniformServer #-}
newPreemptibleRandomUniformServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomUniformServer Bool
preemptible Double
min Double
max =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomUniformProcess_ Double
min Double
max
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomUniformIntServer :: MonadDES m
=> Bool
-> Int
-> Int
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomUniformIntServer #-}
newPreemptibleRandomUniformIntServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Int -> Int -> Simulation m (Server m () a a)
newPreemptibleRandomUniformIntServer Bool
preemptible Int
min Int
max =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *). MonadDES m => Int -> Int -> Process m ()
randomUniformIntProcess_ Int
min Int
max
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomTriangularServer :: MonadDES m
=> Bool
-> Double
-> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomTriangularServer #-}
newPreemptibleRandomTriangularServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool
-> Double -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomTriangularServer Bool
preemptible Double
min Double
median Double
max =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Double -> Process m ()
randomTriangularProcess_ Double
min Double
median Double
max
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomNormalServer :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomNormalServer #-}
newPreemptibleRandomNormalServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomNormalServer Bool
preemptible Double
mu Double
nu =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomNormalProcess_ Double
mu Double
nu
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomLogNormalServer :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomLogNormalServer #-}
newPreemptibleRandomLogNormalServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomLogNormalServer Bool
preemptible Double
mu Double
nu =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomLogNormalProcess_ Double
mu Double
nu
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomExponentialServer :: MonadDES m
=> Bool
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomExponentialServer #-}
newPreemptibleRandomExponentialServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomExponentialServer Bool
preemptible Double
mu =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *). MonadDES m => Double -> Process m ()
randomExponentialProcess_ Double
mu
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomErlangServer :: MonadDES m
=> Bool
-> Double
-> Int
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomErlangServer #-}
newPreemptibleRandomErlangServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Simulation m (Server m () a a)
newPreemptibleRandomErlangServer Bool
preemptible Double
beta Int
m =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *). MonadDES m => Double -> Int -> Process m ()
randomErlangProcess_ Double
beta Int
m
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomPoissonServer :: MonadDES m
=> Bool
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomPoissonServer #-}
newPreemptibleRandomPoissonServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomPoissonServer Bool
preemptible Double
mu =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *). MonadDES m => Double -> Process m ()
randomPoissonProcess_ Double
mu
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomBinomialServer :: MonadDES m
=> Bool
-> Double
-> Int
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomBinomialServer #-}
newPreemptibleRandomBinomialServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Simulation m (Server m () a a)
newPreemptibleRandomBinomialServer Bool
preemptible Double
prob Int
trials =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *). MonadDES m => Double -> Int -> Process m ()
randomBinomialProcess_ Double
prob Int
trials
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomGammaServer :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomGammaServer #-}
newPreemptibleRandomGammaServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomGammaServer Bool
preemptible Double
kappa Double
theta =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomGammaProcess_ Double
kappa Double
theta
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomBetaServer :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomBetaServer #-}
newPreemptibleRandomBetaServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomBetaServer Bool
preemptible Double
alpha Double
beta =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomBetaProcess_ Double
alpha Double
beta
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomWeibullServer :: MonadDES m
=> Bool
-> Double
-> Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomWeibullServer #-}
newPreemptibleRandomWeibullServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Simulation m (Server m () a a)
newPreemptibleRandomWeibullServer Bool
preemptible Double
alpha Double
beta =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomWeibullProcess_ Double
alpha Double
beta
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
newPreemptibleRandomDiscreteServer :: MonadDES m
=> Bool
-> DiscretePDF Double
-> Simulation m (Server m () a a)
{-# INLINABLE newPreemptibleRandomDiscreteServer #-}
newPreemptibleRandomDiscreteServer :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> DiscretePDF Double -> Simulation m (Server m () a a)
newPreemptibleRandomDiscreteServer Bool
preemptible DiscretePDF Double
dpdf =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible forall a b. (a -> b) -> a -> b
$ \a
a ->
do forall (m :: * -> *).
MonadDES m =>
DiscretePDF Double -> Process m ()
randomDiscreteProcess_ DiscretePDF Double
dpdf
forall (m :: * -> *) a. Monad m => a -> m a
return a
a