Learn R Programming

SimInf (version 11.1.0)

summary,SimInf_model-method: Detailed summary of a SimInf_model object

Description

Display a summary of a SimInf_model object, including the model name, number of nodes, number of replicates (if greater than one), transitions, global data, local data, scheduled events, continuous state variables, and compartments. Compared to show, the summary additionally displays transition details, global and local data summaries, and scheduled events overview.

Usage

# S4 method for SimInf_model
summary(object, ...)

Value

NULL, returned invisibly.

Arguments

object

The SimInf_model object to summarize.

...

Additional arguments affecting the summary produced. Currently ignored.

Details

As with the show method, the output differs depending on whether the model has been run: before running, the result matrices (U and V) are empty; after calling run, they contain the simulated trajectory data.

See Also

SimInf_model for creating model objects, run for simulating a trajectory from a model, SimInf_model for the class definition, show for a brief summary.

Examples

Run this code
## For reproducibility, specify the number of threads.
set_num_threads(1)

## Create an 'SIR' model with 10 nodes and initialise
## it to run over 100 days.
model <- SIR(
  u0 = data.frame(
    S = rep(99, 10),
    I = rep(1, 10),
    R = rep(0, 10)
  ),
  tspan = 1:100,
  beta = 0.16,
  gamma = 0.077
)

## Detailed summary of the model
model

## Run the model with a fixed seed for reproducibility.
result <- run(model, seed = 22)

## Detailed summary of the result. Note that the trajectory is
## non-empty after running the model.
result

Run the code above in your browser using DataLab