Skip to content

Commit

Permalink
Adjusted spacing formatting in recovery rates function and make ifels…
Browse files Browse the repository at this point in the history
…e statement explicit for vivax in rendering.
  • Loading branch information
RJSheppard committed Jul 30, 2024
1 parent cbce0b3 commit 3d6909c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions R/disease_progression.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ create_recovery_rates_process <- function(
recovery_rates <- variables$recovery_rates$get_values()
if (parameters$parasite == "vivax"){
# p.v subpatent recovery is immunity-dependent
recovery_rates[variables$state$get_index_of("U")$to_vector()] <-
1/anti_parasite_immunity(
parameters$dpcr_min, parameters$dpcr_max, parameters$apcr50, parameters$kpcr,
variables$iaa$get_values(index = variables$state$get_index_of("U")),
variables$iam$get_values(index = variables$state$get_index_of("U"))

U_index <- variables$state$get_index_of("U")

recovery_rates[U_index$to_vector()] <-
1 / anti_parasite_immunity(
min = parameters$dpcr_min,
max = parameters$dpcr_max,
a50 = parameters$apcr50,
k = parameters$kpcr,
iaa = variables$iaa$get_values(index = U_index),
iam =variables$iam$get_values(index = U_index)
)
}
recovery_outcome$set_rates(recovery_rates)
Expand Down
2 changes: 1 addition & 1 deletion R/render.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ create_prevelance_renderer <- function(
parameters
)
asymptomatic_detected <- bitset_at(asymptomatic, bernoulli_multi_p(prob))
} else {
} else if (parameters$parasite == "vivax") {
asymptomatic_detected <- asymptomatic
}

Expand Down

0 comments on commit 3d6909c

Please sign in to comment.