Skip to contents

The scenario class is intended to store the outcomes of a number of runs of an epidemic simulation. This is a work in progress, and is initially targeted for compatibility with outputs from finalsize::final_size().

Usage

scenario(
  name = NA_character_,
  model_function,
  parameters,
  extra_info = list(),
  replicates = 1L
)

Arguments

name

The scenario name as a string. Defaults to NA if not provided.

model_function

Function that is expected to run an epidemic scenario model, such as finalsize::final_size(), as a string e.g. "finalsize::final_size". Explicit namespacing is preferred.

parameters

Parameters to the model_function.

extra_info

Extra information that is useful when comparing scenarios, such as details of the population structure or infection characteristics.

replicates

The number of scenario replicates. This is the number of times the model_function is run.

Value

A scenario object

Examples

# prepare arguments to `finalsize::final_size()`
# using the included convenience function
pandemic_flu_args <- make_parameters_finalsize_UK(r0 = 1.5)

# prepare extra information on age group limits
age_groups <- rownames(pandemic_flu_args$contact_matrix)

scenario(
  model_function = "finalsize::final_size",
  parameters = pandemic_flu_args,
  extra_info = list(
    age_groups = age_groups
  ),
  replicates = 1L
)
#> Epidemic scenario object
#>  Scenario name: No name specified (NA)
#>  Model function: finalsize::final_size
#>  Extra information on: "age_groups"
#>  Scenario replicates: 1
#>  Scenario outcomes are not prepared