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 class 'SimInf_model'
summary(object, ...)Arguments
- object
The
SimInf_modelobject 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
## 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
#> Model: SIR
#> Number of nodes: 10
#> Number of transitions: 2
#> Number of scheduled events: 0
#>
#> Local data
#> ----------
#> Parameter Value
#> beta 0.160
#> gamma 0.077
#>
#> Compartments
#> ------------
#> - Empty, please run the model first
## 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
#> Model: SIR
#> Number of nodes: 10
#> Number of transitions: 2
#> Number of scheduled events: 0
#>
#> Local data
#> ----------
#> Parameter Value
#> beta 0.160
#> gamma 0.077
#>
#> Compartments
#> ------------
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> S 11.0 32.0 66.0 62.7 98.0 99.0
#> I 0.0 1.0 6.0 7.8 12.0 36.0
#> R 0.0 2.0 16.5 29.5 58.2 88.0