sim.outer.tree | R Documentation |
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.
sim.outer.tree(model, max.attempts = 5, skip.assign = F)
model: |
R6 object of class 'Model' |
max.attempts: |
maximum number of attempts to simulate outer events. Defaults to 5. |
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.
object of class 'EventLogger'
load.outer.tree
#' # 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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.