View source: R/babsimHospital.R
babsimHospital | R Documentation |
Simulate resource allocation in hospitals.
babsimHospital(arrivalTimes = NULL, conf = list(), para = list(), ...)
arrivalTimes |
Arrival times as generated using |
conf |
list with the following entries:
. Values larger than 1 are mapped to 1. |
para |
List with parameter settings. Can be generated with |
... |
additional parameters passed to |
This function returns an env list with:
xbest
Parameters of the best found solution (matrix).
require("simmer") require("dplyr") # Generate simulation data based on number of infected persons per day: x <- dataCovidBeds20200624 arrivalTimes <- getArrivalTimes(x$Infected) conf <- babsimToolsConf() y <- babsimHospital( arrivalTimes = arrivalTimes, conf = conf, para = babsimHospitalPara() ) resources <- get_mon_resources(y) # resources <- resources %>% filter(resource != "nurse") mean(resources$server) ## 2nd example (shows details): # Generate simulation data based on number of infected persons per day: x <- dataCovidBeds20200624 arrivalTimes <- getArrivalTimes(x$Infected) para <- babsimHospitalPara() conf <- babsimToolsConf() conf$logLevel <- 1 conf$simRepeats <- 1 para$GammaShapeParameter <- 0.8 y <- babsimHospital( arrivalTimes = arrivalTimes, conf = conf, para = para )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.