module Simulation.Aivika.Trans.Operation.Random
(newRandomUniformOperation,
newRandomUniformIntOperation,
newRandomTriangularOperation,
newRandomNormalOperation,
newRandomLogNormalOperation,
newRandomExponentialOperation,
newRandomErlangOperation,
newRandomPoissonOperation,
newRandomBinomialOperation,
newRandomGammaOperation,
newRandomBetaOperation,
newRandomWeibullOperation,
newRandomDiscreteOperation,
newPreemptibleRandomUniformOperation,
newPreemptibleRandomUniformIntOperation,
newPreemptibleRandomTriangularOperation,
newPreemptibleRandomNormalOperation,
newPreemptibleRandomLogNormalOperation,
newPreemptibleRandomExponentialOperation,
newPreemptibleRandomErlangOperation,
newPreemptibleRandomPoissonOperation,
newPreemptibleRandomBinomialOperation,
newPreemptibleRandomGammaOperation,
newPreemptibleRandomBetaOperation,
newPreemptibleRandomWeibullOperation,
newPreemptibleRandomDiscreteOperation) where
import Simulation.Aivika.Trans.DES
import Simulation.Aivika.Trans.Generator
import Simulation.Aivika.Trans.Event
import Simulation.Aivika.Trans.Process
import Simulation.Aivika.Trans.Process.Random
import Simulation.Aivika.Trans.Operation
newRandomUniformOperation :: MonadDES m
=> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomUniformOperation #-}
newRandomUniformOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Event m (Operation m a a)
newRandomUniformOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomUniformOperation Bool
False
newRandomUniformIntOperation :: MonadDES m
=> Int
-> Int
-> Event m (Operation m a a)
{-# INLINABLE newRandomUniformIntOperation #-}
newRandomUniformIntOperation :: forall (m :: * -> *) a.
MonadDES m =>
Int -> Int -> Event m (Operation m a a)
newRandomUniformIntOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Int -> Int -> Event m (Operation m a a)
newPreemptibleRandomUniformIntOperation Bool
False
newRandomTriangularOperation :: MonadDES m
=> Double
-> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomTriangularOperation #-}
newRandomTriangularOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Double -> Event m (Operation m a a)
newRandomTriangularOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomTriangularOperation Bool
False
newRandomNormalOperation :: MonadDES m
=> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomNormalOperation #-}
newRandomNormalOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Event m (Operation m a a)
newRandomNormalOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomNormalOperation Bool
False
newRandomLogNormalOperation :: MonadDES m
=> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomLogNormalOperation #-}
newRandomLogNormalOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Event m (Operation m a a)
newRandomLogNormalOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomLogNormalOperation Bool
False
newRandomExponentialOperation :: MonadDES m
=> Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomExponentialOperation #-}
newRandomExponentialOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Event m (Operation m a a)
newRandomExponentialOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Event m (Operation m a a)
newPreemptibleRandomExponentialOperation Bool
False
newRandomErlangOperation :: MonadDES m
=> Double
-> Int
-> Event m (Operation m a a)
{-# INLINABLE newRandomErlangOperation #-}
newRandomErlangOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Int -> Event m (Operation m a a)
newRandomErlangOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Event m (Operation m a a)
newPreemptibleRandomErlangOperation Bool
False
newRandomPoissonOperation :: MonadDES m
=> Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomPoissonOperation #-}
newRandomPoissonOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Event m (Operation m a a)
newRandomPoissonOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Event m (Operation m a a)
newPreemptibleRandomPoissonOperation Bool
False
newRandomBinomialOperation :: MonadDES m
=> Double
-> Int
-> Event m (Operation m a a)
{-# INLINABLE newRandomBinomialOperation #-}
newRandomBinomialOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Int -> Event m (Operation m a a)
newRandomBinomialOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Event m (Operation m a a)
newPreemptibleRandomBinomialOperation Bool
False
newRandomGammaOperation :: MonadDES m
=> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomGammaOperation #-}
newRandomGammaOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Event m (Operation m a a)
newRandomGammaOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomGammaOperation Bool
False
newRandomBetaOperation :: MonadDES m
=> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomBetaOperation #-}
newRandomBetaOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Event m (Operation m a a)
newRandomBetaOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomBetaOperation Bool
False
newRandomWeibullOperation :: MonadDES m
=> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomWeibullOperation #-}
newRandomWeibullOperation :: forall (m :: * -> *) a.
MonadDES m =>
Double -> Double -> Event m (Operation m a a)
newRandomWeibullOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomWeibullOperation Bool
False
newRandomDiscreteOperation :: MonadDES m
=> DiscretePDF Double
-> Event m (Operation m a a)
{-# INLINABLE newRandomDiscreteOperation #-}
newRandomDiscreteOperation :: forall (m :: * -> *) a.
MonadDES m =>
DiscretePDF Double -> Event m (Operation m a a)
newRandomDiscreteOperation =
forall (m :: * -> *) a.
MonadDES m =>
Bool -> DiscretePDF Double -> Event m (Operation m a a)
newPreemptibleRandomDiscreteOperation Bool
False
newPreemptibleRandomUniformOperation :: MonadDES m
=> Bool
-> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomUniformOperation #-}
newPreemptibleRandomUniformOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomUniformOperation Bool
preemptible Double
min Double
max =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomUniformIntOperation :: MonadDES m
=> Bool
-> Int
-> Int
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomUniformIntOperation #-}
newPreemptibleRandomUniformIntOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Int -> Int -> Event m (Operation m a a)
newPreemptibleRandomUniformIntOperation Bool
preemptible Int
min Int
max =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomTriangularOperation :: MonadDES m
=> Bool
-> Double
-> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomTriangularOperation #-}
newPreemptibleRandomTriangularOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomTriangularOperation Bool
preemptible Double
min Double
median Double
max =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomNormalOperation :: MonadDES m
=> Bool
-> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomNormalOperation #-}
newPreemptibleRandomNormalOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomNormalOperation Bool
preemptible Double
mu Double
nu =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomLogNormalOperation :: MonadDES m
=> Bool
-> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomLogNormalOperation #-}
newPreemptibleRandomLogNormalOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomLogNormalOperation Bool
preemptible Double
mu Double
nu =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomExponentialOperation :: MonadDES m
=> Bool
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomExponentialOperation #-}
newPreemptibleRandomExponentialOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Event m (Operation m a a)
newPreemptibleRandomExponentialOperation Bool
preemptible Double
mu =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomErlangOperation :: MonadDES m
=> Bool
-> Double
-> Int
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomErlangOperation #-}
newPreemptibleRandomErlangOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Event m (Operation m a a)
newPreemptibleRandomErlangOperation Bool
preemptible Double
beta Int
m =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomPoissonOperation :: MonadDES m
=> Bool
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomPoissonOperation #-}
newPreemptibleRandomPoissonOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Event m (Operation m a a)
newPreemptibleRandomPoissonOperation Bool
preemptible Double
mu =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomBinomialOperation :: MonadDES m
=> Bool
-> Double
-> Int
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomBinomialOperation #-}
newPreemptibleRandomBinomialOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Int -> Event m (Operation m a a)
newPreemptibleRandomBinomialOperation Bool
preemptible Double
prob Int
trials =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomGammaOperation :: MonadDES m
=> Bool
-> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomGammaOperation #-}
newPreemptibleRandomGammaOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomGammaOperation Bool
preemptible Double
kappa Double
theta =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomBetaOperation :: MonadDES m
=> Bool
-> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomBetaOperation #-}
newPreemptibleRandomBetaOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomBetaOperation Bool
preemptible Double
alpha Double
beta =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomWeibullOperation :: MonadDES m
=> Bool
-> Double
-> Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomWeibullOperation #-}
newPreemptibleRandomWeibullOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> Double -> Double -> Event m (Operation m a a)
newPreemptibleRandomWeibullOperation Bool
preemptible Double
alpha Double
beta =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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
newPreemptibleRandomDiscreteOperation :: MonadDES m
=> Bool
-> DiscretePDF Double
-> Event m (Operation m a a)
{-# INLINABLE newPreemptibleRandomDiscreteOperation #-}
newPreemptibleRandomDiscreteOperation :: forall (m :: * -> *) a.
MonadDES m =>
Bool -> DiscretePDF Double -> Event m (Operation m a a)
newPreemptibleRandomDiscreteOperation Bool
preemptible DiscretePDF Double
dpdf =
forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Event m (Operation m a b)
newPreemptibleOperation 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