Skip to content

Commit

Permalink
Fix min_wait > 0 bug in pev_epi
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannic committed Mar 10, 2023
1 parent 2f72e7d commit 9b80d68
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/pev.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ create_epi_pev_process <- function(
if (parameters$pev_epi_min_wait == 0) {
target <- to_vaccinate$to_vector()
} else {
not_recently_vaccinated <- variables$vaccinated_timestep$get_index_of(
not_recently_vaccinated <- variables$pev_timestep$get_index_of(
a = max(timestep - parameters$pev_epi_min_wait, 0),
b = timestep
)$not(TRUE)
Expand Down
3 changes: 2 additions & 1 deletion R/pev_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ rtss_booster_profile <- create_pev_profile(
#' @param profile primary vaccine profile of type PEVProfile
#' @param coverages a vector of coverages for the primary doses
#' @param timesteps a vector of timesteps associated with coverages
#' @param age for the target population, (in timesteps)
#' @param age the age when an individual will receive the first dose of the
#' vaccine (in timesteps)
#' @param min_wait the minimum acceptable time since the last vaccination (in
#' timesteps); When seasonal_boosters = TRUE, this represents the minimum time
#' between an individual receiving the final dose and the first booster. When using
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-pev-epi.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test_that('pev epi targets correct age and respects min_wait', {
variables$birth <- individual::IntegerVariable$new(
-c(18, 18, 2.9, 18, 18) * 365 + timestep
)
variables$vaccinated_timestep <- mock_integer(
variables$pev_timestep <- mock_integer(
c(50, -1, -1, 4*365, -1)
)

Expand Down

0 comments on commit 9b80d68

Please sign in to comment.