aivika-1.3: A multi-paradigm simulation library

CopyrightCopyright (c) 2009-2013, David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell98

Simulation.Aivika.Dynamics

Contents

Description

Tested with: GHC 7.6.3

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

Synopsis

Dynamics Monad

data Dynamics a Source

A value in the Dynamics monad represents a polymorphic time varying function.

class DynamicsLift m where Source

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

Methods

liftDynamics :: Dynamics a -> m a Source

Lift the specified Dynamics computation to another computation.

runDynamicsInStartTime :: Dynamics a -> Simulation a Source

Run the Dynamics computation in the initial time point.

runDynamicsInStopTime :: Dynamics a -> Simulation a Source

Run the Dynamics computation in the final time point.

runDynamicsInIntegTimes :: Dynamics a -> Simulation [IO a] Source

Run the Dynamics computation in all integration time points.

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

Run the Dynamics computation in the specified time point.

runDynamicsInTimes :: [Double] -> Dynamics a -> Simulation [IO a] Source

Run the Dynamics computation in the specified time points.

Error Handling

catchDynamics :: Dynamics a -> (IOException -> Dynamics a) -> Dynamics a Source

Exception handling within Dynamics computations.

finallyDynamics :: Dynamics a -> Dynamics b -> Dynamics a Source

A computation with finalization part like the finally function.

throwDynamics :: IOException -> Dynamics a Source

Like the standard throw function.

Simulation Time

time :: Dynamics Double Source

Computation that returns the current simulation time.

isTimeInteg :: Dynamics Bool Source

Whether the current time is an integration time.

integIteration :: Dynamics Int Source

Return the integration iteration closest to the current simulation time.

integPhase :: Dynamics Int Source

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