Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved mortality to the end of processes to resolve order of competing… #292

Merged
merged 2 commits into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions R/processes.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ create_processes <- function(
create_exponential_decay_process(variables$iva, parameters$rva),
create_exponential_decay_process(variables$id, parameters$rid)
)

if (parameters$individual_mosquitoes) {
processes <- c(
processes,
Expand All @@ -61,7 +61,7 @@ create_processes <- function(
)
)
}

# ==============================
# Biting and mortality processes
# ==============================
Expand All @@ -82,7 +82,6 @@ create_processes <- function(
mixing,
mixing_index
),
create_mortality_process(variables, events, renderer, parameters),
create_asymptomatic_progression_process(
variables$state,
parameters$dd,
Expand Down Expand Up @@ -134,15 +133,15 @@ create_processes <- function(
0
)
)

# ===============
# ODE integration
# ===============
processes <- c(
processes,
create_solver_stepping_process(solvers, parameters)
)

# =========
# RTS,S EPI
# =========
Expand All @@ -159,7 +158,7 @@ create_processes <- function(
)
)
}

# =========
# PMC
# =========
Expand All @@ -178,7 +177,7 @@ create_processes <- function(
)
)
}

# =========
# Rendering
# =========
Expand Down Expand Up @@ -208,7 +207,7 @@ create_processes <- function(
),
create_compartmental_rendering_process(renderer, solvers, parameters)
)

if (parameters$individual_mosquitoes) {
processes <- c(
processes,
Expand All @@ -230,11 +229,11 @@ create_processes <- function(
)
)
}

# ======================
# Intervention processes
# ======================

if (parameters$bednets) {
processes <- c(
processes,
Expand All @@ -247,14 +246,14 @@ create_processes <- function(
net_usage_renderer(variables$net_time, renderer)
)
}

if (parameters$spraying) {
processes <- c(
processes,
indoor_spraying(variables$spray_time, parameters, correlations)
)
}

# ======================
# Progress bar process
# ======================
Expand All @@ -264,7 +263,12 @@ create_processes <- function(
create_progress_process(timesteps)
)
}


# Mortality step
processes <- c(
processes,
create_mortality_process(variables, events, renderer, parameters))

processes
}

Expand All @@ -289,7 +293,7 @@ create_exponential_decay_process <- function(variable, rate) {
#' @title Create and initialise lagged_infectivity object
#'
#' @param variables model variables for initialisation
#' @param parameters model parameters
#' @param parameters model parameters
#' @noRd
create_lagged_infectivity <- function(variables, parameters) {
age <- get_age(variables$birth$get_values(), 0)
Expand All @@ -306,7 +310,7 @@ create_lagged_infectivity <- function(variables, parameters) {
#'
#' @param variables model variables for initialisation
#' @param solvers model differential equation solvers
#' @param parameters model parameters
#' @param parameters model parameters
#' @noRd
create_lagged_eir <- function(variables, solvers, parameters) {
lapply(
Expand Down
Loading