Create a results summary

library(treat.sim)

A quick summary of KPIs

Use the create_summary_table function to calculate mean results for each performance measure across replications.

First we run 10 replications of the model:

# create default experiment - turn off event logging
default_experiment <- create_experiment(log_level=0)

# run 5 replications of the model (return is list of simmer envs)
envs <- multiple_replications(default_experiment, n_reps=10)
#> [1] "running replications..."
#> [1] "Complete."

# convert envs into a data.table of KPIs by replication.
rep_table <- replication_results_table(envs, default_experiment)

Then we pass the data.frame containing the replications to the create_summary_table function.

summary_table <- create_summary_table(rep_table)
summary_table
#>                                  mean
#> 00_arrivals                    228.50
#> 01a_triage_wait                 29.59
#> 01b_triage_util                  0.59
#> 02a_registration_wait          108.24
#> 02b_registration_util            0.83
#> 03a_examination_wait            27.24
#> 03b_examination_util             0.83
#> 04a_treatment_wait(non_trauma) 136.42
#> 04b_treatment_util(non_trauma)   0.85
#> 05_total_time(non-trauma)      235.82
#> 06a_stabilisation_wait         246.10
#> 06b_stabilisation_util           0.79
#> 07a_treatment_wait(trauma)       7.52
#> 07b_treatment_util(trauma)       0.29
#> 08_total_time(trauma)          380.71
#> 09_throughput                  152.00

A histogram of a selected KPI

To quickly create a histogram use the histogram_of_replications function. Set the column_name parameter to one of the KPI names listed in the summary table above. E.g.

throughput <- histogram_of_replications(rep_table, "09_throughput", "patients")
arrivals  <- histogram_of_replications(rep_table, "00_arrivals", "patients")

throughput

arrivals