View source: R/getDailyMaxResults.R
getDailyMaxResults | R Documentation |
Combine babsim simulation results with real (field) data. Use daily max resources.
Input: simmer
simulation environment and field data formatted
using getRealBeds
. The formatted filed date has dim (nxm, 5), the output data
has dimension (nxm, 15).
The method get_mon_resources
function is used to extract information from
the babsim.hospital
simulation.
The function is used by modelResultHospital
to prepare the calculation of the error.
getDailyMaxResults(envs, fieldEvents, conf)
envs |
|
fieldEvents |
Real values. Output from
|
conf |
list with the following entries (generated with
|
get_mon_resources
returns state changes in resources:
'resource': resources name
'time': time instant of the event that triggered the state change
'server': server count
'queue': queue count
'capacity': capacity
'queue_size': queue size
'system': system count (server + queue). If no queues are used, system values equal server values.
'system_limit': system limit (capacity + queue_size)
This function returns an env data frame (tibble [nxm, 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 ...
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' ...
modelResultHospital
data <- getSyntheticData() para <- babsimHospitalPara() conf <- babsimToolsConf() conf <- getConfFromData( conf = conf, simData = data$simData, fieldData = data$fieldData ) arrivalTimes <- getArrivalTimes(data$simData$Infected) envs <- babsimHospital(arrivalTimes = arrivalTimes, conf = conf, para = para) fieldEvents <- getRealBeds( data = data$fieldData, resource = c("bed", "intensiveBed", "intensiveBedVentilation") ) res <- getDailyMaxResults(envs = envs, fieldEvents = fieldEvents, conf = conf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.