module Simulation.Aivika.Trans.Processor.Random
(randomUniformProcessor,
randomUniformIntProcessor,
randomTriangularProcessor,
randomNormalProcessor,
randomLogNormalProcessor,
randomExponentialProcessor,
randomErlangProcessor,
randomPoissonProcessor,
randomBinomialProcessor,
randomGammaProcessor,
randomBetaProcessor,
randomWeibullProcessor,
randomDiscreteProcessor) where
import Simulation.Aivika.Trans.DES
import Simulation.Aivika.Trans.Generator
import Simulation.Aivika.Trans.Process
import Simulation.Aivika.Trans.Process.Random
import Simulation.Aivika.Trans.Processor
randomUniformProcessor :: MonadDES m
=> Double
-> Double
-> Processor m a a
{-# INLINABLE randomUniformProcessor #-}
randomUniformProcessor :: Double -> Double -> Processor m a a
randomUniformProcessor Double
min Double
max =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomUniformProcess_ Double
min Double
max
randomUniformIntProcessor :: MonadDES m
=> Int
-> Int
-> Processor m a a
{-# INLINABLE randomUniformIntProcessor #-}
randomUniformIntProcessor :: Int -> Int -> Processor m a a
randomUniformIntProcessor Int
min Int
max =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Int -> Int -> Process m ()
forall (m :: * -> *). MonadDES m => Int -> Int -> Process m ()
randomUniformIntProcess_ Int
min Int
max
randomTriangularProcessor :: MonadDES m
=> Double
-> Double
-> Double
-> Processor m a a
{-# INLINABLE randomTriangularProcessor #-}
randomTriangularProcessor :: Double -> Double -> Double -> Processor m a a
randomTriangularProcessor Double
min Double
median Double
max =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Double -> Process m ()
randomTriangularProcess_ Double
min Double
median Double
max
randomNormalProcessor :: MonadDES m
=> Double
-> Double
-> Processor m a a
{-# INLINABLE randomNormalProcessor #-}
randomNormalProcessor :: Double -> Double -> Processor m a a
randomNormalProcessor Double
mu Double
nu =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomNormalProcess_ Double
mu Double
nu
randomLogNormalProcessor :: MonadDES m
=> Double
-> Double
-> Processor m a a
{-# INLINABLE randomLogNormalProcessor #-}
randomLogNormalProcessor :: Double -> Double -> Processor m a a
randomLogNormalProcessor Double
mu Double
nu =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomLogNormalProcess_ Double
mu Double
nu
randomExponentialProcessor :: MonadDES m
=> Double
-> Processor m a a
{-# INLINABLE randomExponentialProcessor #-}
randomExponentialProcessor :: Double -> Processor m a a
randomExponentialProcessor Double
mu =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Process m ()
forall (m :: * -> *). MonadDES m => Double -> Process m ()
randomExponentialProcess_ Double
mu
randomErlangProcessor :: MonadDES m
=> Double
-> Int
-> Processor m a a
{-# INLINABLE randomErlangProcessor #-}
randomErlangProcessor :: Double -> Int -> Processor m a a
randomErlangProcessor Double
beta Int
m =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Int -> Process m ()
forall (m :: * -> *). MonadDES m => Double -> Int -> Process m ()
randomErlangProcess_ Double
beta Int
m
randomPoissonProcessor :: MonadDES m
=> Double
-> Processor m a a
{-# INLINABLE randomPoissonProcessor #-}
randomPoissonProcessor :: Double -> Processor m a a
randomPoissonProcessor Double
mu =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Process m ()
forall (m :: * -> *). MonadDES m => Double -> Process m ()
randomPoissonProcess_ Double
mu
randomBinomialProcessor :: MonadDES m
=> Double
-> Int
-> Processor m a a
{-# INLINABLE randomBinomialProcessor #-}
randomBinomialProcessor :: Double -> Int -> Processor m a a
randomBinomialProcessor Double
prob Int
trials =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Int -> Process m ()
forall (m :: * -> *). MonadDES m => Double -> Int -> Process m ()
randomBinomialProcess_ Double
prob Int
trials
randomGammaProcessor :: MonadDES m
=> Double
-> Double
-> Processor m a a
{-# INLINABLE randomGammaProcessor #-}
randomGammaProcessor :: Double -> Double -> Processor m a a
randomGammaProcessor Double
kappa Double
theta =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomGammaProcess_ Double
kappa Double
theta
randomBetaProcessor :: MonadDES m
=> Double
-> Double
-> Processor m a a
{-# INLINABLE randomBetaProcessor #-}
randomBetaProcessor :: Double -> Double -> Processor m a a
randomBetaProcessor Double
alpha Double
beta =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomBetaProcess_ Double
alpha Double
beta
randomWeibullProcessor :: MonadDES m
=> Double
-> Double
-> Processor m a a
{-# INLINABLE randomWeibullProcessor #-}
randomWeibullProcessor :: Double -> Double -> Processor m a a
randomWeibullProcessor Double
alpha Double
beta =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
Double -> Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
Double -> Double -> Process m ()
randomWeibullProcess_ Double
alpha Double
beta
randomDiscreteProcessor :: MonadDES m
=> DiscretePDF Double
-> Processor m a a
{-# INLINABLE randomDiscreteProcessor #-}
randomDiscreteProcessor :: DiscretePDF Double -> Processor m a a
randomDiscreteProcessor DiscretePDF Double
dpdf =
Process m () -> Processor m a a
forall (m :: * -> *) a.
MonadDES m =>
Process m () -> Processor m a a
withinProcessor (Process m () -> Processor m a a)
-> Process m () -> Processor m a a
forall a b. (a -> b) -> a -> b
$
DiscretePDF Double -> Process m ()
forall (m :: * -> *).
MonadDES m =>
DiscretePDF Double -> Process m ()
randomDiscreteProcess_ DiscretePDF Double
dpdf