Copyright | Copyright (c) 2016-2017 David Sorokin <david.sorokin@gmail.com> |
---|---|

License | BSD3 |

Maintainer | David Sorokin <david.sorokin@gmail.com> |

Stability | experimental |

Safe Haskell | Safe-Inferred |

Language | Haskell2010 |

Tested with: GHC 7.10.3

This module defines `LIO`

as an instance of the `MonadDES`

and `EventIOQueueing`

type classes.

## Synopsis

- data LIO a
- data LIOLattice
- lattice :: Int -> (Int -> Int -> Int) -> LIOLattice
- newRandomLattice :: Int -> IO LIOLattice
- newRandomLatticeWithProb :: Double -> Int -> IO LIOLattice
- runLIO :: LIOLattice -> LIO a -> IO a
- latticeTimeIndex :: LIO Int
- latticeMemberIndex :: LIO Int
- latticeParentMemberIndex :: LIO (Maybe Int)
- latticeSize :: LIO Int
- latticeTime :: Parameter LIO Double
- latticeTimes :: Parameter LIO [Double]
- latticeTimeStep :: Parameter LIO Double
- findLatticeTimeIndex :: Double -> Parameter LIO Int
- enqueueEventWithLatticeTimes :: Event LIO () -> Event LIO ()

# Documentation

The `LIO`

computation that can be run as nested one on the lattice node.

#### Instances

data LIOLattice Source #

Specifies the lattice.

:: Int | the lattice size |

-> (Int -> Int -> Int) | get the parent member index by the specified time and member indices |

-> LIOLattice |

Return a lattice by the specifed size and the parent member function.

newRandomLattice :: Int -> IO LIOLattice Source #

Create a new random lattice by the specified size with equal probabilities, whether the interior child node derives from the left or right parents.

newRandomLatticeWithProb :: Double -> Int -> IO LIOLattice Source #

Create a new random lattice by the specified probability and size, where the probability defines whether the interior child node derives from the right parent.

latticeTimeIndex :: LIO Int Source #

Return the lattice time index starting from 0. The index should be less than or equaled to `latticeSize`

.

latticeMemberIndex :: LIO Int Source #

Return the lattice member index starting from 0. It is always less than or equaled to `latticeTimeIndex`

.

latticeParentMemberIndex :: LIO (Maybe Int) Source #

Return the parent member index starting from 0 for non-root lattice nodes.

latticeSize :: LIO Int Source #

Return the lattice size.

findLatticeTimeIndex :: Double -> Parameter LIO Int Source #

Find the lattice time index by the specified modeling time.

enqueueEventWithLatticeTimes :: Event LIO () -> Event LIO () Source #

Actuate the event handler in the lattice node time points.