module Simulation.Aivika.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.Generator
import Simulation.Aivika.Simulation
import Simulation.Aivika.Process
import Simulation.Aivika.Process.Random
import Simulation.Aivika.Server
newRandomUniformServer :: Double
-> Double
-> Simulation (Server () a a)
newRandomUniformServer :: Double -> Double -> Simulation (Server () a a)
newRandomUniformServer =
Bool -> Double -> Double -> Simulation (Server () a a)
forall a. Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomUniformServer Bool
False
newRandomUniformIntServer :: Int
-> Int
-> Simulation (Server () a a)
newRandomUniformIntServer :: Int -> Int -> Simulation (Server () a a)
newRandomUniformIntServer =
Bool -> Int -> Int -> Simulation (Server () a a)
forall a. Bool -> Int -> Int -> Simulation (Server () a a)
newPreemptibleRandomUniformIntServer Bool
False
newRandomTriangularServer :: Double
-> Double
-> Double
-> Simulation (Server () a a)
newRandomTriangularServer :: Double -> Double -> Double -> Simulation (Server () a a)
newRandomTriangularServer =
Bool -> Double -> Double -> Double -> Simulation (Server () a a)
forall a.
Bool -> Double -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomTriangularServer Bool
False
newRandomNormalServer :: Double
-> Double
-> Simulation (Server () a a)
newRandomNormalServer :: Double -> Double -> Simulation (Server () a a)
newRandomNormalServer =
Bool -> Double -> Double -> Simulation (Server () a a)
forall a. Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomNormalServer Bool
False
newRandomLogNormalServer :: Double
-> Double
-> Simulation (Server () a a)
newRandomLogNormalServer :: Double -> Double -> Simulation (Server () a a)
newRandomLogNormalServer =
Bool -> Double -> Double -> Simulation (Server () a a)
forall a. Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomLogNormalServer Bool
False
newRandomExponentialServer :: Double
-> Simulation (Server () a a)
newRandomExponentialServer :: Double -> Simulation (Server () a a)
newRandomExponentialServer =
Bool -> Double -> Simulation (Server () a a)
forall a. Bool -> Double -> Simulation (Server () a a)
newPreemptibleRandomExponentialServer Bool
False
newRandomErlangServer :: Double
-> Int
-> Simulation (Server () a a)
newRandomErlangServer :: Double -> Int -> Simulation (Server () a a)
newRandomErlangServer =
Bool -> Double -> Int -> Simulation (Server () a a)
forall a. Bool -> Double -> Int -> Simulation (Server () a a)
newPreemptibleRandomErlangServer Bool
False
newRandomPoissonServer :: Double
-> Simulation (Server () a a)
newRandomPoissonServer :: Double -> Simulation (Server () a a)
newRandomPoissonServer =
Bool -> Double -> Simulation (Server () a a)
forall a. Bool -> Double -> Simulation (Server () a a)
newPreemptibleRandomPoissonServer Bool
False
newRandomBinomialServer :: Double
-> Int
-> Simulation (Server () a a)
newRandomBinomialServer :: Double -> Int -> Simulation (Server () a a)
newRandomBinomialServer =
Bool -> Double -> Int -> Simulation (Server () a a)
forall a. Bool -> Double -> Int -> Simulation (Server () a a)
newPreemptibleRandomBinomialServer Bool
False
newRandomGammaServer :: Double
-> Double
-> Simulation (Server () a a)
newRandomGammaServer :: Double -> Double -> Simulation (Server () a a)
newRandomGammaServer =
Bool -> Double -> Double -> Simulation (Server () a a)
forall a. Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomGammaServer Bool
False
newRandomBetaServer :: Double
-> Double
-> Simulation (Server () a a)
newRandomBetaServer :: Double -> Double -> Simulation (Server () a a)
newRandomBetaServer =
Bool -> Double -> Double -> Simulation (Server () a a)
forall a. Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomBetaServer Bool
False
newRandomWeibullServer :: Double
-> Double
-> Simulation (Server () a a)
newRandomWeibullServer :: Double -> Double -> Simulation (Server () a a)
newRandomWeibullServer =
Bool -> Double -> Double -> Simulation (Server () a a)
forall a. Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomWeibullServer Bool
False
newRandomDiscreteServer :: DiscretePDF Double
-> Simulation (Server () a a)
newRandomDiscreteServer :: DiscretePDF Double -> Simulation (Server () a a)
newRandomDiscreteServer =
Bool -> DiscretePDF Double -> Simulation (Server () a a)
forall a. Bool -> DiscretePDF Double -> Simulation (Server () a a)
newPreemptibleRandomDiscreteServer Bool
False
newPreemptibleRandomUniformServer :: Bool
-> Double
-> Double
-> Simulation (Server () a a)
newPreemptibleRandomUniformServer :: Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomUniformServer Bool
preemptible Double
min Double
max =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomUniformIntServer :: Bool
-> Int
-> Int
-> Simulation (Server () a a)
newPreemptibleRandomUniformIntServer :: Bool -> Int -> Int -> Simulation (Server () a a)
newPreemptibleRandomUniformIntServer Bool
preemptible Int
min Int
max =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomTriangularServer :: Bool
-> Double
-> Double
-> Double
-> Simulation (Server () a a)
newPreemptibleRandomTriangularServer :: Bool -> Double -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomTriangularServer Bool
preemptible Double
min Double
median Double
max =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomNormalServer :: Bool
-> Double
-> Double
-> Simulation (Server () a a)
newPreemptibleRandomNormalServer :: Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomNormalServer Bool
preemptible Double
mu Double
nu =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomLogNormalServer :: Bool
-> Double
-> Double
-> Simulation (Server () a a)
newPreemptibleRandomLogNormalServer :: Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomLogNormalServer Bool
preemptible Double
mu Double
nu =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomExponentialServer :: Bool
-> Double
-> Simulation (Server () a a)
newPreemptibleRandomExponentialServer :: Bool -> Double -> Simulation (Server () a a)
newPreemptibleRandomExponentialServer Bool
preemptible Double
mu =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomErlangServer :: Bool
-> Double
-> Int
-> Simulation (Server () a a)
newPreemptibleRandomErlangServer :: Bool -> Double -> Int -> Simulation (Server () a a)
newPreemptibleRandomErlangServer Bool
preemptible Double
beta Int
m =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomPoissonServer :: Bool
-> Double
-> Simulation (Server () a a)
newPreemptibleRandomPoissonServer :: Bool -> Double -> Simulation (Server () a a)
newPreemptibleRandomPoissonServer Bool
preemptible Double
mu =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomBinomialServer :: Bool
-> Double
-> Int
-> Simulation (Server () a a)
newPreemptibleRandomBinomialServer :: Bool -> Double -> Int -> Simulation (Server () a a)
newPreemptibleRandomBinomialServer Bool
preemptible Double
prob Int
trials =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomGammaServer :: Bool
-> Double
-> Double
-> Simulation (Server () a a)
newPreemptibleRandomGammaServer :: Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomGammaServer Bool
preemptible Double
kappa Double
theta =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomBetaServer :: Bool
-> Double
-> Double
-> Simulation (Server () a a)
newPreemptibleRandomBetaServer :: Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomBetaServer Bool
preemptible Double
alpha Double
beta =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomWeibullServer :: Bool
-> Double
-> Double
-> Simulation (Server () a a)
newPreemptibleRandomWeibullServer :: Bool -> Double -> Double -> Simulation (Server () a a)
newPreemptibleRandomWeibullServer Bool
preemptible Double
alpha Double
beta =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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
newPreemptibleRandomDiscreteServer :: Bool
-> DiscretePDF Double
-> Simulation (Server () a a)
newPreemptibleRandomDiscreteServer :: Bool -> DiscretePDF Double -> Simulation (Server () a a)
newPreemptibleRandomDiscreteServer Bool
preemptible DiscretePDF Double
dpdf =
Bool -> (a -> Process a) -> Simulation (Server () a a)
forall a b. Bool -> (a -> Process b) -> Simulation (Server () a b)
newPreemptibleServer Bool
preemptible ((a -> Process a) -> Simulation (Server () a a))
-> (a -> Process a) -> Simulation (Server () 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