Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | Safe-Inferred |
Tested with: GHC 7.0.3
The module defines the Simulation
monad representing a simulation run.
- data Simulation a
- class Monad m => SimulationLift m where
- liftSimulation :: Simulation a -> m a
- data Specs = Specs {
- spcStartTime :: Double
- spcStopTime :: Double
- spcDT :: Double
- spcMethod :: Method
- data Method
- = Euler
- | RungeKutta2
- | RungeKutta4
- runSimulation :: Simulation a -> Specs -> IO a
- runSimulations :: Simulation a -> Specs -> Int -> [IO a]
- simulationIndex :: Simulation Int
- simulationCount :: Simulation Int
- simulationSpecs :: Simulation Specs
Documentation
data Simulation a Source
A value in the Simulation
monad represents a simulation run.
class Monad m => SimulationLift m whereSource
A type class to lift the simulation computations in other monads.
liftSimulation :: Simulation a -> m aSource
Lift the specified Simulation
computation in another monad.
It defines the simulation specs.
Specs | |
|
It defines the integration method.
Euler | Euler's method |
RungeKutta2 | the 2nd order Runge-Kutta method |
RungeKutta4 | the 4th order Runge-Kutta method |
runSimulation :: Simulation a -> Specs -> IO aSource
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
.
simulationIndex :: Simulation IntSource
Return the run index for the current simulation.
simulationCount :: Simulation IntSource
Return the number of simulations currently run.
simulationSpecs :: Simulation SpecsSource
Return the simulation specs