module Simulation.Aivika.Trans.Dynamics.Random
(memoRandomUniformDynamics,
memoRandomUniformIntDynamics,
memoRandomTriangularDynamics,
memoRandomNormalDynamics,
memoRandomLogNormalDynamics,
memoRandomExponentialDynamics,
memoRandomErlangDynamics,
memoRandomPoissonDynamics,
memoRandomBinomialDynamics,
memoRandomGammaDynamics,
memoRandomBetaDynamics,
memoRandomWeibullDynamics,
memoRandomDiscreteDynamics) where
import Simulation.Aivika.Trans.Generator
import Simulation.Aivika.Trans.Internal.Specs
import Simulation.Aivika.Trans.Internal.Parameter
import Simulation.Aivika.Trans.Internal.Simulation
import Simulation.Aivika.Trans.Internal.Dynamics
import Simulation.Aivika.Trans.Dynamics.Memo.Unboxed
import Simulation.Aivika.Trans.SD
memoRandomUniformDynamics :: MonadSD m
=> Dynamics m Double
-> Dynamics m Double
-> Simulation m (Dynamics m Double)
{-# INLINABLE memoRandomUniformDynamics #-}
memoRandomUniformDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double
-> Dynamics m Double -> Simulation m (Dynamics m Double)
memoRandomUniformDynamics Dynamics m Double
min Dynamics m Double
max =
Dynamics m Double -> Simulation m (Dynamics m Double)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Double -> Simulation m (Dynamics m Double))
-> Dynamics m Double -> Simulation m (Dynamics m Double)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Double) -> Dynamics m Double
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Double) -> Dynamics m Double)
-> (Point m -> m Double) -> Dynamics m Double
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
min' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
min
Double
max' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
max
Generator m -> Double -> Double -> m Double
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> Double -> m Double
generateUniform Generator m
g Double
min' Double
max'
memoRandomUniformIntDynamics :: MonadSD m
=> Dynamics m Int
-> Dynamics m Int
-> Simulation m (Dynamics m Int)
{-# INLINABLE memoRandomUniformIntDynamics #-}
memoRandomUniformIntDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Int -> Dynamics m Int -> Simulation m (Dynamics m Int)
memoRandomUniformIntDynamics Dynamics m Int
min Dynamics m Int
max =
Dynamics m Int -> Simulation m (Dynamics m Int)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Int -> Simulation m (Dynamics m Int))
-> Dynamics m Int -> Simulation m (Dynamics m Int)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Int) -> Dynamics m Int
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Int) -> Dynamics m Int)
-> (Point m -> m Int) -> Dynamics m Int
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Int
min' <- Point m -> Dynamics m Int -> m Int
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Int
min
Int
max' <- Point m -> Dynamics m Int -> m Int
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Int
max
Generator m -> Int -> Int -> m Int
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Int -> Int -> m Int
generateUniformInt Generator m
g Int
min' Int
max'
memoRandomTriangularDynamics :: MonadSD m
=> Dynamics m Double
-> Dynamics m Double
-> Dynamics m Double
-> Simulation m (Dynamics m Double)
{-# INLINABLE memoRandomTriangularDynamics #-}
memoRandomTriangularDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double
-> Dynamics m Double
-> Dynamics m Double
-> Simulation m (Dynamics m Double)
memoRandomTriangularDynamics Dynamics m Double
min Dynamics m Double
median Dynamics m Double
max =
Dynamics m Double -> Simulation m (Dynamics m Double)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Double -> Simulation m (Dynamics m Double))
-> Dynamics m Double -> Simulation m (Dynamics m Double)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Double) -> Dynamics m Double
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Double) -> Dynamics m Double)
-> (Point m -> m Double) -> Dynamics m Double
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
min' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
min
Double
median' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
median
Double
max' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
max
Generator m -> Double -> Double -> Double -> m Double
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> Double -> Double -> m Double
generateTriangular Generator m
g Double
min' Double
median' Double
max'
memoRandomNormalDynamics :: MonadSD m
=> Dynamics m Double
-> Dynamics m Double
-> Simulation m (Dynamics m Double)
{-# INLINABLE memoRandomNormalDynamics #-}
memoRandomNormalDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double
-> Dynamics m Double -> Simulation m (Dynamics m Double)
memoRandomNormalDynamics Dynamics m Double
mu Dynamics m Double
nu =
Dynamics m Double -> Simulation m (Dynamics m Double)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Double -> Simulation m (Dynamics m Double))
-> Dynamics m Double -> Simulation m (Dynamics m Double)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Double) -> Dynamics m Double
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Double) -> Dynamics m Double)
-> (Point m -> m Double) -> Dynamics m Double
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
mu' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
mu
Double
nu' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
nu
Generator m -> Double -> Double -> m Double
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> Double -> m Double
generateNormal Generator m
g Double
mu' Double
nu'
memoRandomLogNormalDynamics :: MonadSD m
=> Dynamics m Double
-> Dynamics m Double
-> Simulation m (Dynamics m Double)
{-# INLINABLE memoRandomLogNormalDynamics #-}
memoRandomLogNormalDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double
-> Dynamics m Double -> Simulation m (Dynamics m Double)
memoRandomLogNormalDynamics Dynamics m Double
mu Dynamics m Double
nu =
Dynamics m Double -> Simulation m (Dynamics m Double)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Double -> Simulation m (Dynamics m Double))
-> Dynamics m Double -> Simulation m (Dynamics m Double)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Double) -> Dynamics m Double
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Double) -> Dynamics m Double)
-> (Point m -> m Double) -> Dynamics m Double
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
mu' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
mu
Double
nu' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
nu
Generator m -> Double -> Double -> m Double
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> Double -> m Double
generateLogNormal Generator m
g Double
mu' Double
nu'
memoRandomExponentialDynamics :: MonadSD m
=> Dynamics m Double
-> Simulation m (Dynamics m Double)
{-# INLINABLE memoRandomExponentialDynamics #-}
memoRandomExponentialDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double -> Simulation m (Dynamics m Double)
memoRandomExponentialDynamics Dynamics m Double
mu =
Dynamics m Double -> Simulation m (Dynamics m Double)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Double -> Simulation m (Dynamics m Double))
-> Dynamics m Double -> Simulation m (Dynamics m Double)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Double) -> Dynamics m Double
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Double) -> Dynamics m Double)
-> (Point m -> m Double) -> Dynamics m Double
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
mu' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
mu
Generator m -> Double -> m Double
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> m Double
generateExponential Generator m
g Double
mu'
memoRandomErlangDynamics :: MonadSD m
=> Dynamics m Double
-> Dynamics m Int
-> Simulation m (Dynamics m Double)
{-# INLINABLE memoRandomErlangDynamics #-}
memoRandomErlangDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double
-> Dynamics m Int -> Simulation m (Dynamics m Double)
memoRandomErlangDynamics Dynamics m Double
beta Dynamics m Int
m =
Dynamics m Double -> Simulation m (Dynamics m Double)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Double -> Simulation m (Dynamics m Double))
-> Dynamics m Double -> Simulation m (Dynamics m Double)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Double) -> Dynamics m Double
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Double) -> Dynamics m Double)
-> (Point m -> m Double) -> Dynamics m Double
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
beta' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
beta
Int
m' <- Point m -> Dynamics m Int -> m Int
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Int
m
Generator m -> Double -> Int -> m Double
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> Int -> m Double
generateErlang Generator m
g Double
beta' Int
m'
memoRandomPoissonDynamics :: MonadSD m
=> Dynamics m Double
-> Simulation m (Dynamics m Int)
{-# INLINABLE memoRandomPoissonDynamics #-}
memoRandomPoissonDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double -> Simulation m (Dynamics m Int)
memoRandomPoissonDynamics Dynamics m Double
mu =
Dynamics m Int -> Simulation m (Dynamics m Int)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Int -> Simulation m (Dynamics m Int))
-> Dynamics m Int -> Simulation m (Dynamics m Int)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Int) -> Dynamics m Int
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Int) -> Dynamics m Int)
-> (Point m -> m Int) -> Dynamics m Int
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
mu' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
mu
Generator m -> Double -> m Int
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> m Int
generatePoisson Generator m
g Double
mu'
memoRandomBinomialDynamics :: MonadSD m
=> Dynamics m Double
-> Dynamics m Int
-> Simulation m (Dynamics m Int)
{-# INLINABLE memoRandomBinomialDynamics #-}
memoRandomBinomialDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double
-> Dynamics m Int -> Simulation m (Dynamics m Int)
memoRandomBinomialDynamics Dynamics m Double
prob Dynamics m Int
trials =
Dynamics m Int -> Simulation m (Dynamics m Int)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Int -> Simulation m (Dynamics m Int))
-> Dynamics m Int -> Simulation m (Dynamics m Int)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Int) -> Dynamics m Int
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Int) -> Dynamics m Int)
-> (Point m -> m Int) -> Dynamics m Int
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
prob' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
prob
Int
trials' <- Point m -> Dynamics m Int -> m Int
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Int
trials
Generator m -> Double -> Int -> m Int
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> Int -> m Int
generateBinomial Generator m
g Double
prob' Int
trials'
memoRandomGammaDynamics :: MonadSD m
=> Dynamics m Double
-> Dynamics m Double
-> Simulation m (Dynamics m Double)
{-# INLINABLE memoRandomGammaDynamics #-}
memoRandomGammaDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double
-> Dynamics m Double -> Simulation m (Dynamics m Double)
memoRandomGammaDynamics Dynamics m Double
kappa Dynamics m Double
theta =
Dynamics m Double -> Simulation m (Dynamics m Double)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Double -> Simulation m (Dynamics m Double))
-> Dynamics m Double -> Simulation m (Dynamics m Double)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Double) -> Dynamics m Double
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Double) -> Dynamics m Double)
-> (Point m -> m Double) -> Dynamics m Double
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
kappa' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
kappa
Double
theta' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
theta
Generator m -> Double -> Double -> m Double
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> Double -> m Double
generateGamma Generator m
g Double
kappa' Double
theta'
memoRandomBetaDynamics :: MonadSD m
=> Dynamics m Double
-> Dynamics m Double
-> Simulation m (Dynamics m Double)
{-# INLINABLE memoRandomBetaDynamics #-}
memoRandomBetaDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double
-> Dynamics m Double -> Simulation m (Dynamics m Double)
memoRandomBetaDynamics Dynamics m Double
alpha Dynamics m Double
beta =
Dynamics m Double -> Simulation m (Dynamics m Double)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Double -> Simulation m (Dynamics m Double))
-> Dynamics m Double -> Simulation m (Dynamics m Double)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Double) -> Dynamics m Double
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Double) -> Dynamics m Double)
-> (Point m -> m Double) -> Dynamics m Double
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
alpha' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
alpha
Double
beta' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
beta
Generator m -> Double -> Double -> m Double
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> Double -> m Double
generateBeta Generator m
g Double
alpha' Double
beta'
memoRandomWeibullDynamics :: MonadSD m
=> Dynamics m Double
-> Dynamics m Double
-> Simulation m (Dynamics m Double)
{-# INLINABLE memoRandomWeibullDynamics #-}
memoRandomWeibullDynamics :: forall (m :: * -> *).
MonadSD m =>
Dynamics m Double
-> Dynamics m Double -> Simulation m (Dynamics m Double)
memoRandomWeibullDynamics Dynamics m Double
alpha Dynamics m Double
beta =
Dynamics m Double -> Simulation m (Dynamics m Double)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m Double -> Simulation m (Dynamics m Double))
-> Dynamics m Double -> Simulation m (Dynamics m Double)
forall a b. (a -> b) -> a -> b
$
(Point m -> m Double) -> Dynamics m Double
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m Double) -> Dynamics m Double)
-> (Point m -> m Double) -> Dynamics m Double
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
Double
alpha' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
alpha
Double
beta' <- Point m -> Dynamics m Double -> m Double
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m Double
beta
Generator m -> Double -> Double -> m Double
forall (m :: * -> *).
MonadGenerator m =>
Generator m -> Double -> Double -> m Double
generateWeibull Generator m
g Double
alpha' Double
beta'
memoRandomDiscreteDynamics :: (MonadSD m, MonadMemo m a) => Dynamics m (DiscretePDF a) -> Simulation m (Dynamics m a)
{-# INLINABLE memoRandomDiscreteDynamics #-}
memoRandomDiscreteDynamics :: forall (m :: * -> *) a.
(MonadSD m, MonadMemo m a) =>
Dynamics m (DiscretePDF a) -> Simulation m (Dynamics m a)
memoRandomDiscreteDynamics Dynamics m (DiscretePDF a)
dpdf =
Dynamics m a -> Simulation m (Dynamics m a)
forall (m :: * -> *) e.
MonadMemo m e =>
Dynamics m e -> Simulation m (Dynamics m e)
memo0Dynamics (Dynamics m a -> Simulation m (Dynamics m a))
-> Dynamics m a -> Simulation m (Dynamics m a)
forall a b. (a -> b) -> a -> b
$
(Point m -> m a) -> Dynamics m a
forall (m :: * -> *) a. (Point m -> m a) -> Dynamics m a
Dynamics ((Point m -> m a) -> Dynamics m a)
-> (Point m -> m a) -> Dynamics m a
forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do let g :: Generator m
g = Run m -> Generator m
forall (m :: * -> *). Run m -> Generator m
runGenerator (Run m -> Generator m) -> Run m -> Generator m
forall a b. (a -> b) -> a -> b
$ Point m -> Run m
forall (m :: * -> *). Point m -> Run m
pointRun Point m
p
DiscretePDF a
dpdf' <- Point m -> Dynamics m (DiscretePDF a) -> m (DiscretePDF a)
forall (m :: * -> *) a. Point m -> Dynamics m a -> m a
invokeDynamics Point m
p Dynamics m (DiscretePDF a)
dpdf
Generator m -> DiscretePDF a -> m a
forall a. Generator m -> DiscretePDF a -> m a
forall (m :: * -> *) a.
MonadGenerator m =>
Generator m -> DiscretePDF a -> m a
generateDiscrete Generator m
g DiscretePDF a
dpdf'