module Simulation.Aivika.Trans.Process.Random
(randomUniformProcess,
randomUniformProcess_,
randomUniformIntProcess,
randomUniformIntProcess_,
randomTriangularProcess,
randomTriangularProcess_,
randomNormalProcess,
randomNormalProcess_,
randomLogNormalProcess,
randomLogNormalProcess_,
randomExponentialProcess,
randomExponentialProcess_,
randomErlangProcess,
randomErlangProcess_,
randomPoissonProcess,
randomPoissonProcess_,
randomBinomialProcess,
randomBinomialProcess_,
randomGammaProcess,
randomGammaProcess_,
randomBetaProcess,
randomBetaProcess_,
randomWeibullProcess,
randomWeibullProcess_,
randomDiscreteProcess,
randomDiscreteProcess_) where
import Control.Monad
import Control.Monad.Trans
import Simulation.Aivika.Trans.DES
import Simulation.Aivika.Trans.Generator
import Simulation.Aivika.Trans.Parameter
import Simulation.Aivika.Trans.Parameter.Random
import Simulation.Aivika.Trans.Process
randomUniformProcess :: MonadDES m
=> Double
-> Double
-> Process m Double
{-# INLINABLE randomUniformProcess #-}
randomUniformProcess min max =
do t <- liftParameter $ randomUniform min max
holdProcess t
return t
randomUniformProcess_ :: MonadDES m
=> Double
-> Double
-> Process m ()
{-# INLINABLE randomUniformProcess_ #-}
randomUniformProcess_ min max =
do t <- liftParameter $ randomUniform min max
holdProcess t
randomUniformIntProcess :: MonadDES m
=> Int
-> Int
-> Process m Int
{-# INLINABLE randomUniformIntProcess #-}
randomUniformIntProcess min max =
do t <- liftParameter $ randomUniformInt min max
holdProcess $ fromIntegral t
return t
randomUniformIntProcess_ :: MonadDES m
=> Int
-> Int
-> Process m ()
{-# INLINABLE randomUniformIntProcess_ #-}
randomUniformIntProcess_ min max =
do t <- liftParameter $ randomUniformInt min max
holdProcess $ fromIntegral t
randomTriangularProcess :: MonadDES m
=> Double
-> Double
-> Double
-> Process m Double
{-# INLINABLE randomTriangularProcess #-}
randomTriangularProcess min median max =
do t <- liftParameter $ randomTriangular min median max
holdProcess t
return t
randomTriangularProcess_ :: MonadDES m
=> Double
-> Double
-> Double
-> Process m ()
{-# INLINABLE randomTriangularProcess_ #-}
randomTriangularProcess_ min median max =
do t <- liftParameter $ randomTriangular min median max
holdProcess t
randomNormalProcess :: MonadDES m
=> Double
-> Double
-> Process m Double
{-# INLINABLE randomNormalProcess #-}
randomNormalProcess mu nu =
do t <- liftParameter $ randomNormal mu nu
when (t > 0) $
holdProcess t
return t
randomNormalProcess_ :: MonadDES m
=> Double
-> Double
-> Process m ()
{-# INLINABLE randomNormalProcess_ #-}
randomNormalProcess_ mu nu =
do t <- liftParameter $ randomNormal mu nu
when (t > 0) $
holdProcess t
randomLogNormalProcess :: MonadDES m
=> Double
-> Double
-> Process m Double
{-# INLINABLE randomLogNormalProcess #-}
randomLogNormalProcess mu nu =
do t <- liftParameter $ randomLogNormal mu nu
holdProcess t
return t
randomLogNormalProcess_ :: MonadDES m
=> Double
-> Double
-> Process m ()
{-# INLINABLE randomLogNormalProcess_ #-}
randomLogNormalProcess_ mu nu =
do t <- liftParameter $ randomLogNormal mu nu
holdProcess t
randomExponentialProcess :: MonadDES m
=> Double
-> Process m Double
{-# INLINABLE randomExponentialProcess #-}
randomExponentialProcess mu =
do t <- liftParameter $ randomExponential mu
holdProcess t
return t
randomExponentialProcess_ :: MonadDES m
=> Double
-> Process m ()
{-# INLINABLE randomExponentialProcess_ #-}
randomExponentialProcess_ mu =
do t <- liftParameter $ randomExponential mu
holdProcess t
randomErlangProcess :: MonadDES m
=> Double
-> Int
-> Process m Double
{-# INLINABLE randomErlangProcess #-}
randomErlangProcess beta m =
do t <- liftParameter $ randomErlang beta m
holdProcess t
return t
randomErlangProcess_ :: MonadDES m
=> Double
-> Int
-> Process m ()
{-# INLINABLE randomErlangProcess_ #-}
randomErlangProcess_ beta m =
do t <- liftParameter $ randomErlang beta m
holdProcess t
randomPoissonProcess :: MonadDES m
=> Double
-> Process m Int
{-# INLINABLE randomPoissonProcess #-}
randomPoissonProcess mu =
do t <- liftParameter $ randomPoisson mu
holdProcess $ fromIntegral t
return t
randomPoissonProcess_ :: MonadDES m
=> Double
-> Process m ()
{-# INLINABLE randomPoissonProcess_ #-}
randomPoissonProcess_ mu =
do t <- liftParameter $ randomPoisson mu
holdProcess $ fromIntegral t
randomBinomialProcess :: MonadDES m
=> Double
-> Int
-> Process m Int
{-# INLINABLE randomBinomialProcess #-}
randomBinomialProcess prob trials =
do t <- liftParameter $ randomBinomial prob trials
holdProcess $ fromIntegral t
return t
randomBinomialProcess_ :: MonadDES m
=>Double
-> Int
-> Process m ()
{-# INLINABLE randomBinomialProcess_ #-}
randomBinomialProcess_ prob trials =
do t <- liftParameter $ randomBinomial prob trials
holdProcess $ fromIntegral t
randomGammaProcess :: MonadDES m
=> Double
-> Double
-> Process m Double
{-# INLINABLE randomGammaProcess #-}
randomGammaProcess kappa theta =
do t <- liftParameter $ randomGamma kappa theta
holdProcess t
return t
randomGammaProcess_ :: MonadDES m
=> Double
-> Double
-> Process m ()
{-# INLINABLE randomGammaProcess_ #-}
randomGammaProcess_ kappa theta =
do t <- liftParameter $ randomGamma kappa theta
holdProcess t
randomBetaProcess :: MonadDES m
=> Double
-> Double
-> Process m Double
{-# INLINABLE randomBetaProcess #-}
randomBetaProcess alpha beta =
do t <- liftParameter $ randomBeta alpha beta
holdProcess t
return t
randomBetaProcess_ :: MonadDES m
=> Double
-> Double
-> Process m ()
{-# INLINABLE randomBetaProcess_ #-}
randomBetaProcess_ alpha beta =
do t <- liftParameter $ randomBeta alpha beta
holdProcess t
randomWeibullProcess :: MonadDES m
=> Double
-> Double
-> Process m Double
{-# INLINABLE randomWeibullProcess #-}
randomWeibullProcess alpha beta =
do t <- liftParameter $ randomWeibull alpha beta
holdProcess t
return t
randomWeibullProcess_ :: MonadDES m
=> Double
-> Double
-> Process m ()
{-# INLINABLE randomWeibullProcess_ #-}
randomWeibullProcess_ alpha beta =
do t <- liftParameter $ randomWeibull alpha beta
holdProcess t
randomDiscreteProcess :: MonadDES m
=> DiscretePDF Double
-> Process m Double
{-# INLINABLE randomDiscreteProcess #-}
randomDiscreteProcess dpdf =
do t <- liftParameter $ randomDiscrete dpdf
holdProcess t
return t
randomDiscreteProcess_ :: MonadDES m
=> DiscretePDF Double
-> Process m ()
{-# INLINABLE randomDiscreteProcess_ #-}
randomDiscreteProcess_ dpdf =
do t <- liftParameter $ randomDiscrete dpdf
holdProcess t