aivika-transformers-4.3.2: Transformers for the Aivika simulation library

CopyrightCopyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Simulation.Aivika.Trans.Dynamics

Contents

Description

Tested with: GHC 7.10.1

The module defines the Dynamics monad tranformer representing a time varying polymorphic function.

Synopsis

Dynamics Monad

data Dynamics m a Source

A value in the Dynamics monad represents a polymorphic time varying function defined in the whole spectrum of time values as a single entity. It is ideal for numerical approximating integrals.

class DynamicsLift t m where Source

A type class to lift the Dynamics computations into other computations.

Methods

liftDynamics :: Dynamics m a -> t m a Source

Lift the specified Dynamics computation into another computation.

runDynamicsInStartTime :: Dynamics m a -> Simulation m a Source

Run the Dynamics computation in the initial time point.

runDynamicsInStopTime :: Dynamics m a -> Simulation m a Source

Run the Dynamics computation in the final time point.

runDynamicsInIntegTimes :: Monad m => Dynamics m a -> Simulation m [m a] Source

Run the Dynamics computation in all integration time points.

runDynamicsInTime :: Double -> Dynamics m a -> Simulation m a Source

Run the Dynamics computation in the specified time point.

runDynamicsInTimes :: Monad m => [Double] -> Dynamics m a -> Simulation m [m a] Source

Run the Dynamics computation in the specified time points.

Error Handling

catchDynamics :: (MonadException m, Exception e) => Dynamics m a -> (e -> Dynamics m a) -> Dynamics m a Source

Exception handling within Dynamics computations.

finallyDynamics :: MonadException m => Dynamics m a -> Dynamics m b -> Dynamics m a Source

A computation with finalization part like the finally function.

throwDynamics :: (MonadException m, Exception e) => e -> Dynamics m a Source

Like the standard throw function.

Simulation Time

time :: Monad m => Dynamics m Double Source

Computation that returns the current simulation time.

isTimeInteg :: Monad m => Dynamics m Bool Source

Whether the current time is an integration time.

integIteration :: Monad m => Dynamics m Int Source

Return the integration iteration closest to the current simulation time.

integPhase :: Monad m => Dynamics m Int Source

Return the integration phase for the current simulation time. It is (-1) for non-integration time points.

Debugging

traceDynamics :: Monad m => String -> Dynamics m a -> Dynamics m a Source

Show the debug message with the current simulation time.