modelResultHospital {babsim.hospital}R Documentation

modelResultHospital

Description

Simulate one parameter configuration from babsimHospitalPara. The simulation is by default deterministic, because conf$seed is used for set.seed.

Usage

modelResultHospital(para, conf, data)

Arguments

para

Simulation model parameters. The function babsimHospitalPara can be used to generate these parameters.

conf

list with the following entries:

seed

seed. Change the seed value to get different output for the same input parameters. 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)

maxCapacity

max capacity of resources. Default: 1e6

dataset

char name of the data set. Default: 'GA'

simulationDates

list with StartDate and EndDate. Period that is used for the simulation (babsim, simmer). Default: list(StartDate = '2020-03-03', EndDate = '2020-06-24')

fieldDates

list with StartDate and EndDate. Period when real data is available (resource usage). Default: list(StartDate = '2020-03-03', EndDate = '2020-06-24')

simulationData

data frame. Data used for the simulation. Default: dataCovidBeds20200624

fieldEvents

data frame. Data used for the evaluation (error). Default: GABeds220200624

resource

vector with resource names. Default: c('bed', 'intensiveBed', 'intensiveBedVentilation')

data

list with simData and fieldData

Value

This function returns an env data frame (tibble [560 × 15] (S3: grouped_df/tbl_df/tbl/data.frame)) with the following entries:

resource (chr)

name of the seized resource: 'bed' 'bed' 'bed' 'bed' ...

time (num)

time step: 3 10 12 13 14 15 15 15 15 16 ...

server (int)

server: 1 2 3 2 3 4 3 4 5 6 ...

queue (int)

1 1 2 3 4 3 4 1 0 2 ...

capacity (num)

10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 ...

queue_size (num)

Inf Inf Inf Inf Inf ...

system (int)

1 1 2 3 4 3 4 1 0 2 ...

limit (num)

limit: Inf Inf Inf Inf Inf ...

replication (int)

replication: 1 1 1 1 1 1 1 1 1 1 ...

upper (int)

upper: 1 2 3 2 3 5 5 5 5 7 ...

lower (int)

lower: 1 2 3 2 3 3 3 3 3 5 ...

med (num)

med: 1 2 3 2 3 4 4 4 4 6 ...

date (POSIXct)

time, format: yyyy-mm-dd hh:mm.ss

rwdate (POSIXct)

format: '2020-03-01' '2020-03-08' '2020-03-15' '2020-03-15' ...

source (chr)

name of the simulation that was used: 'babsim' 'babsim' 'babsim' 'babsim' ...

Examples

# First example: OBK data
data <- getObkData()
para <- babsimHospitalPara()
para$GammaShapeParameter <- 0.8
# turn off parallelized simulation:
conf <- babsimToolsConf()
conf <- getConfFromData(
  conf = conf,
  simData = data$simData,
  fieldData = data$fieldData
)
# no logging (default)
conf$logLevel <- 0
res <- modelResultHospital(
  para = para,
  conf = conf,
  data = data
)

# Second example: synthetic data
data <- getSyntheticData()
para <- babsimHospitalPara()
conf <- babsimToolsConf()
conf <- getConfFromData(
  conf = conf,
  simData = data$simData,
  fieldData = data$fieldData
)
res <- modelResultHospital(para = para, conf = conf, data = data)

[Package babsim.hospital version 11.8.8 Index]