Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- initialIdentifier :: Identifier
- inhomExponential :: PrimMonad m => Timed Double -> AbsoluteTime -> Gen (PrimState m) -> m (Maybe AbsoluteTime)
- randomPerson :: People -> GenIO -> IO (Person, People)
- maybeToRight :: a -> Maybe b -> Either a b
- newPerson :: Identifier -> (Person, Identifier)
- isReconTreeLeaf :: EpidemicEvent -> Bool
- simulationWithSystem :: (ModelParameters a b, Population b) => SimulationConfiguration a b c -> (a -> AbsoluteTime -> Maybe (TerminationHandler b c) -> SimulationState b c -> GenIO -> IO (SimulationState b c)) -> IO (Either (Maybe c) [EpidemicEvent])
- simulationWithFixedSeed :: (ModelParameters a b, Population b) => SimulationConfiguration a b c -> (a -> AbsoluteTime -> Maybe (TerminationHandler b c) -> SimulationState b c -> GenIO -> IO (SimulationState b c)) -> IO (Either (Maybe c) [EpidemicEvent])
- simulationWithGenIO :: (ModelParameters a b, Population b) => SimulationConfiguration a b c -> (a -> AbsoluteTime -> Maybe (TerminationHandler b c) -> SimulationState b c -> GenIO -> IO (SimulationState b c)) -> GenIO -> IO (Either (Maybe c) [EpidemicEvent])
Documentation
:: PrimMonad m | |
=> Timed Double | Step function |
-> AbsoluteTime | Start time |
-> Gen (PrimState m) | Generator |
-> m (Maybe AbsoluteTime) |
Generate exponentially distributed random variates with inhomogeneous rate starting from a particular point in time.
Assuming the stepFunc
is the intensity of arrivals and t0
is the start
time this returns t1
the time of the next arrival.
randomPerson :: People -> GenIO -> IO (Person, People) Source #
A random person and the remaining group of people after they have been sampled with removal.
maybeToRight :: a -> Maybe b -> Either a b Source #
Helper function for converting between the Maybe monad and the Either monad.
newPerson :: Identifier -> (Person, Identifier) Source #
A new person constructed from the given identifier and a new identifier.
isReconTreeLeaf :: EpidemicEvent -> Bool Source #
Predicate for whether an epidemic event will appear as a leaf in the reconstructed tree. For scheduled sequenced samples this will only return true if there was at least one lineage observed.
simulationWithSystem :: (ModelParameters a b, Population b) => SimulationConfiguration a b c -> (a -> AbsoluteTime -> Maybe (TerminationHandler b c) -> SimulationState b c -> GenIO -> IO (SimulationState b c)) -> IO (Either (Maybe c) [EpidemicEvent]) Source #
Run a simulation described by a configuration object but using a random seed generated by the system rather than a seed
simulationWithFixedSeed :: (ModelParameters a b, Population b) => SimulationConfiguration a b c -> (a -> AbsoluteTime -> Maybe (TerminationHandler b c) -> SimulationState b c -> GenIO -> IO (SimulationState b c)) -> IO (Either (Maybe c) [EpidemicEvent]) Source #
Run a simulation using a fixed PRNG random seed.
simulationWithGenIO :: (ModelParameters a b, Population b) => SimulationConfiguration a b c -> (a -> AbsoluteTime -> Maybe (TerminationHandler b c) -> SimulationState b c -> GenIO -> IO (SimulationState b c)) -> GenIO -> IO (Either (Maybe c) [EpidemicEvent]) Source #
Run a simulation described by a configuration object and the model's
allEvents
style function (see the example in
Epidemic.Model.InhomogeneousBDSCOD) using the provided PRNG.