Learn R Programming

SimInf (version 11.1.0)

show,SimInf_model-method: Brief summary of a SimInf_model object

Description

Display key characteristics of a SimInf_model object, including the model name, number of nodes, number of replicates (if greater than one), number of transitions, scheduled events, global data, local data, continuous state variables, and compartments.

Usage

# S4 method for SimInf_model
show(object)

Value

The object, returned invisibly.

Arguments

object

The SimInf_model object to display.

Details

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 and the summary reflects the computed results.

See Also

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

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
)

## Brief summary of the model
model

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

## Brief 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