babsimHospital: babsimHospital

View source: R/babsimHospital.R

babsimHospitalR Documentation

babsimHospital

Description

Simulate resource allocation in hospitals.

Usage

babsimHospital(arrivalTimes = NULL, conf = list(), para = list(), ...)

Arguments

arrivalTimes

Arrival times as generated using getArrivalTimes.

conf

list with the following entries:

seed

seed. Default: 123

simRepeats

simmer repeats

parallel

simmer parallel runs. Default: FALSE

perCores

percentage of cores used for parallel simmer simulations. Default: 0.5 (=50 percent)

ICU

use ICU infection data. Default: FALSE

logLevel

log leved (0 or 1). Default: 0 (no output)

. Values larger than 1 are mapped to 1.

para

List with parameter settings. Can be generated with babsimHospitalPara.

...

additional parameters passed to fun.

Value

This function returns an env list with:

xbest

Parameters of the best found solution (matrix).

Examples


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
)

babsim.hospital documentation built on May 30, 2022, 9:05 a.m.