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