epi-sim-0.2.2.0: A library for simulating epidemics as birth-death processes.

Safe HaskellNone
LanguageHaskell2010

Epidemic.Types.Parameter

Synopsis

Documentation

newtype Timed a Source #

Type containing values at times. The times are increasing as required by asTimed.

Constructors

Timed [(Time, a)] 
Instances
Eq a => Eq (Timed a) Source # 
Instance details

Defined in Epidemic.Types.Parameter

Methods

(==) :: Timed a -> Timed a -> Bool #

(/=) :: Timed a -> Timed a -> Bool #

Show a => Show (Timed a) Source # 
Instance details

Defined in Epidemic.Types.Parameter

Methods

showsPrec :: Int -> Timed a -> ShowS #

show :: Timed a -> String #

showList :: [Timed a] -> ShowS #

Generic (Timed a) Source # 
Instance details

Defined in Epidemic.Types.Parameter

Associated Types

type Rep (Timed a) :: Type -> Type #

Methods

from :: Timed a -> Rep (Timed a) x #

to :: Rep (Timed a) x -> Timed a #

Semigroup (Timed a) Source # 
Instance details

Defined in Epidemic.Types.Parameter

Methods

(<>) :: Timed a -> Timed a -> Timed a #

sconcat :: NonEmpty (Timed a) -> Timed a #

stimes :: Integral b => b -> Timed a -> Timed a #

ToJSON a => ToJSON (Timed a) Source # 
Instance details

Defined in Epidemic.Types.Parameter

FromJSON a => FromJSON (Timed a) Source # 
Instance details

Defined in Epidemic.Types.Parameter

type Rep (Timed a) Source # 
Instance details

Defined in Epidemic.Types.Parameter

type Rep (Timed a) = D1 (MetaData "Timed" "Epidemic.Types.Parameter" "epi-sim-0.2.2.0-Ha1De45mQngC03CdEKHswB" True) (C1 (MetaCons "Timed" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Time, a)])))

asTimed Source #

Arguments

:: Num a 
=> [(Time, a)]

list of ascending times and values

-> Maybe (Timed a) 

Construct a timed list if possible.

isAscending :: Ord a => [a] -> Bool Source #

Predicate to check if a list of orderable objects is in ascending order.

cadlagValue :: Timed a -> Time -> Maybe a Source #

Evaluate the timed object treating it as a cadlag function

cadlagValue' :: [(Time, a)] -> Time -> Maybe a Source #

diracDeltaValue :: Timed a -> Time -> Maybe a Source #

Evaluate the timed object treating it as a direct delta function

hasTime :: Timed a -> Time -> Bool Source #

Check if there exists a pair with a particular time index.

hasTime' :: [(Time, a)] -> Time -> Bool Source #

nextTime :: Timed a -> Time -> Maybe Time Source #

Return the value of the next time if possible or an exact match if it exists.

nextTime' :: [(Time, a)] -> Time -> Maybe Time Source #