diff --git a/R/biting_process.R b/R/biting_process.R index 801aea20..279802ea 100644 --- a/R/biting_process.R +++ b/R/biting_process.R @@ -210,9 +210,7 @@ simulate_bites <- function( calculate_eir <- function(species, solvers, variables, parameters, timestep) { a <- human_blood_meal_rate(species, variables, parameters, timestep) infectious <- calculate_infectious(species, solvers, variables, parameters) - age <- get_age(variables$birth$get_values(), timestep) - psi <- unique_biting_rate(age, parameters) - infectious * a * mean(psi) + infectious * a } effective_biting_rates <- function(a, .pi, p_bitten) { diff --git a/tests/testthat/test-biology.R b/tests/testthat/test-biology.R index c739f7e7..35372eee 100644 --- a/tests/testthat/test-biology.R +++ b/tests/testthat/test-biology.R @@ -23,7 +23,10 @@ test_that('total_M and EIR functions are consistent with equilibrium EIR', { }) expect_equal( - actual_EIR, + actual_EIR * 0.766, + # 0.766 is the population average psi under an exponential pop distribution + # There's possibly a better way of calculating this, depending on what exactly + # we're testing here, e.g., we could remove lines 19-21 and omega from line 22 expected_EIR, tolerance = 1e-2 ) @@ -51,7 +54,10 @@ test_that('total_M and EIR functions are consistent with equilibrium EIR (with h }) expect_equal( - actual_EIR, + actual_EIR * 0.766, + # 0.766 is the population average psi under an exponential pop distribution + # There's possibly a better way of calculating this, depending on what exactly + # we're testing here, e.g., we could remove lines 49-51 and omega from line 52 expected_EIR, tolerance = 1e-2 )