epi-sim-0.7.0: A library for simulating epidemics as birth-death processes.
Safe HaskellNone
LanguageHaskell2010

Epidemic.Types.Events

Synopsis

Documentation

data EpidemicEvent Source #

Events that can occur in an epidemic with their absolute time.

Constructors

Infection AbsoluteTime Person Person

absolute time; infector; infectee

Removal AbsoluteTime Person 
IndividualSample AbsoluteTime Person Bool 
PopulationSample AbsoluteTime People Bool 
Extinction AbsoluteTime

epidemic went extinct

StoppingTime AbsoluteTime

the simulation reached the stopping time

Instances

Instances details
Eq EpidemicEvent Source # 
Instance details

Defined in Epidemic.Types.Events

Ord EpidemicEvent Source #

Epidemic Events are ordered based on which occurred first. Since Extinction and StoppingTime events are there as placeholders they are placed as the end of the order.

Instance details

Defined in Epidemic.Types.Events

Show EpidemicEvent Source # 
Instance details

Defined in Epidemic.Types.Events

Generic EpidemicEvent Source # 
Instance details

Defined in Epidemic.Types.Events

Associated Types

type Rep EpidemicEvent :: Type -> Type #

ToJSON EpidemicEvent Source # 
Instance details

Defined in Epidemic.Types.Events

FromJSON EpidemicEvent Source # 
Instance details

Defined in Epidemic.Types.Events

TimeStamp EpidemicEvent Source # 
Instance details

Defined in Epidemic.Types.Events

type Rep EpidemicEvent Source # 
Instance details

Defined in Epidemic.Types.Events

type Rep EpidemicEvent = D1 ('MetaData "EpidemicEvent" "Epidemic.Types.Events" "epi-sim-0.7.0-DViI2uXntfg6JZVuToo6fh" 'False) ((C1 ('MetaCons "Infection" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AbsoluteTime) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Person) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Person))) :+: (C1 ('MetaCons "Removal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AbsoluteTime) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Person)) :+: C1 ('MetaCons "IndividualSample" 'PrefixI 'True) (S1 ('MetaSel ('Just "indSampTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AbsoluteTime) :*: (S1 ('MetaSel ('Just "indSampPerson") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Person) :*: S1 ('MetaSel ('Just "indSampSeq") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))) :+: (C1 ('MetaCons "PopulationSample" 'PrefixI 'True) (S1 ('MetaSel ('Just "popSampTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AbsoluteTime) :*: (S1 ('MetaSel ('Just "popSampPeople") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 People) :*: S1 ('MetaSel ('Just "popSampSeq") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :+: (C1 ('MetaCons "Extinction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AbsoluteTime)) :+: C1 ('MetaCons "StoppingTime" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AbsoluteTime)))))

data EpidemicTree Source #

The whole transmission tree including the unobserved leaves. Lineages that are still extant are modelled as shoots and contain a Person as their data rather than an event.

Instances

Instances details
Eq EpidemicTree Source # 
Instance details

Defined in Epidemic.Types.Events

Show EpidemicTree Source # 
Instance details

Defined in Epidemic.Types.Events

maybeEpidemicTree Source #

Arguments

:: [EpidemicEvent]

ordered epidemic events

-> Either String EpidemicTree 

If possible return an EpidemicTree describing the sorted list of EpidemicEvent.

isExtinctionOrStopping :: EpidemicEvent -> Bool Source #

Predicate for whether an EpidemicEvent is one of the terminal events of extinction or the stopping time having been reached.

isIndividualSample :: EpidemicEvent -> Bool Source #

Predicate for the event being an individual sample event.

derivedFrom Source #

Arguments

:: Person 
-> [EpidemicEvent]

ordered epidemic events

-> [EpidemicEvent] 

The events that occurred as a result of the existance of the given person.