sim.outer.tree: sim.outer.tree

View source: R/simOuterTree.R

sim.outer.treeR Documentation

sim.outer.tree

Description

After the objects are generated from user inputs ('loadInputs.R'), we need to initialize the list of fixed events. We anticipate three use cases: 1. User provides a string or object representing the transmission tree that should be converted into an EventLogger object to use for inner tree simulation ('attach.tree'). 2. User manually inputs a host transmission tree into YAML format under Compartments header ('load.outer.tree'). 3. No host tree provided, transmission events need to be simulated under user-specified model ('sim.outer.tree').

sim.outer.tree simulates transmission, migration and transition events and fixes them to the timeline of lineage sampled events.

Usage

sim.outer.tree(model, max.attempts = 5, skip.assign = F)

Arguments

model:

R6 object of class 'Model'

max.attempts:

maximum number of attempts to simulate outer events. Defaults to 5.

Details

A *transmission* is the passage of one or more Lineages from a source Compartment to an uninfected recipient Compartment that did not carry any Lineages.

A *migration* is the passage of one or more Lineages from a source Compartment to a recipient Compartment that has already been infected (it already carries one or more Lineages).

A *transition* occurs when a Compartment switches to another Type. This is useful for handling host death events, for example.

Value

object of class 'EventLogger'

See Also

load.outer.tree

Examples


#' # load susceptible-infected (SI) compartmental model
path <- system.file('extdata', 'structSI.yaml', package='twt')
settings <- yaml.load_file(path)
model <- Model$new(settings)

run <- sim.outer.tree(model)
run$get.eventlog()


PoonLab/twt documentation built on Nov. 7, 2024, 4:18 a.m.