Skip to content

Commit

Permalink
Expose dt/steps_per_day control
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Jan 19, 2021
1 parent 56c879b commit 5e85a26
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 4 additions & 1 deletion R/carehomes.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ NULL
##' rate is used for all age groups; if a vector of values if used it should
##' have one value per age group.
##'
##' @param steps_per_day Number of steps to use per day (integer, at least 1)
##'
##' @param model_pcr_and_serology_user A value of 1 or 0 so switch on or off the
##' flows out of T_PCR_neg and T_sero_neg and the corresponding cap on the
##' number of individuals leaving the R compartments
Expand Down Expand Up @@ -276,9 +278,10 @@ carehomes_parameters <- function(start_date, region,
vaccine_daily_doses = 0,
waning_rate = 0,
model_pcr_and_serology_user = 1,
steps_per_day = 4,
exp_noise = 1e6) {
ret <- sircovid_parameters_shared(start_date, region,
beta_date, beta_value)
beta_date, beta_value, steps_per_day)

## These are only used here, and are fixed
carehome_occupancy <- 0.742
Expand Down
10 changes: 8 additions & 2 deletions R/parameters.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
## These could be moved to be defaults within the models
sircovid_parameters_shared <- function(start_date, region,
beta_date, beta_value) {
dt <- 0.25
beta_date, beta_value,
steps_per_day = 4) {
assert_scalar(steps_per_day)
assert_integer(steps_per_day)
if (steps_per_day < 1) {
stop("'steps_per_day' must be at least 1")
}
assert_sircovid_date(start_date)
dt <- 1 / steps_per_day
beta_step <- sircovid_parameters_beta(beta_date, beta_value %||% 0.08, dt)
list(hosp_transmission = 0.1,
ICU_transmission = 0.05,
Expand Down
3 changes: 3 additions & 0 deletions man/carehomes_parameters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5e85a26

Please sign in to comment.