aivika-4.3: A multi-paradigm simulation library

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

Simulation.Aivika.Simulation

Contents

Description

Tested with: GHC 7.10.1

The module defines the Simulation monad that represents a computation within the simulation run.

Synopsis

Simulation

class SimulationLift m where Source

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

Methods

liftSimulation :: Simulation a -> m a Source

Lift the specified Simulation computation to another computation.

runSimulation :: Simulation a -> Specs -> IO a Source

Run the simulation using the specified specs.

runSimulations :: Simulation a -> Specs -> Int -> [IO a] Source

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

Error Handling

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

Exception handling within Simulation computations.

finallySimulation :: Simulation a -> Simulation b -> Simulation a Source

A computation with finalization part like the finally function.

throwSimulation :: Exception e => e -> Simulation a Source

Like the standard throw function.

Memoization

memoSimulation :: Simulation a -> Simulation (Simulation a) Source

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

Exceptions

data SimulationException Source

The root of simulation exceptions.

Constructors

forall e . Exception e => SimulationException e

A particular simulation exception.

data SimulationAbort Source

An exception that signals of aborting the simulation.

Constructors

SimulationAbort

The exception to abort the simulation.