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

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

Simulation.Aivika.Trans.Simulation

Contents

Description

Tested with: GHC 7.8.3

The module defines the SimulationT monad transformer that represents a simulation run.

Synopsis

Simulation

class SimulationLift t where Source

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

Methods

liftSimulation :: MonadComp m => Simulation m a -> t m a Source

Lift the specified Simulation computation into another computation.

runSimulation :: MonadComp m => Simulation m a -> Specs m -> m a Source

Run the simulation using the specified specs.

runSimulations :: MonadComp m => Simulation m a -> Specs m -> Int -> [m a] Source

Run the given number of simulations using the specified specs, where each simulation is distinguished by its index simulationIndex.

Error Handling

catchSimulation :: (MonadComp m, Exception e) => Simulation m a -> (e -> Simulation m a) -> Simulation m a Source

Exception handling within Simulation computations.

finallySimulation :: MonadComp m => Simulation m a -> Simulation m b -> Simulation m a Source

A computation with finalization part like the finally function.

throwSimulation :: (MonadComp m, Exception e) => e -> Simulation m a Source

Like the standard throw function.

Memoization

memoSimulation :: MonadComp m => Simulation m a -> Simulation m (Simulation m a) Source

Memoize the Simulation computation, always returning the same value within a simulation run.