From 6c090022b5783587322b1b223123b9913392be68 Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 14 Oct 2024 16:39:44 -0700 Subject: [PATCH] Travel and exposure while traveling In this revision, we made a commitment to using the "travel FoI" + The function `traveling` is now called in Blood Feeding to set pars$time_traveling + time_traveling reduces local time at risk, but it is used again to estimate the FoI do to exposure while traveling + Exposure while traveling is now a function travel_eir with a mean, seasonal signal and trend --- NAMESPACE | 15 +-- R/blood_feeding.R | 4 +- R/exposure-multiday.R | 15 ++- R/exposure.R | 17 ++-- R/travel_eir.R | 30 ++++++ R/travel_malaria.R | 83 ---------------- R/traveling.R | 94 +++++++++++++++++++ R/xds-template.R | 7 +- _pkgdown.yml | 19 ++-- docs/reference/Exposure.xde.html | 7 +- docs/reference/index.html | 42 ++++++--- man/Exposure.Rd | 2 +- man/Exposure.dts.Rd | 2 +- man/Exposure.multiday.Rd | 2 +- man/Exposure.xde.Rd | 7 +- man/make_xds_template.Rd | 2 +- ...avel_static.Rd => setup_dynamic_travel.Rd} | 15 ++- man/setup_no_travel.Rd | 19 ++++ man/setup_static_travel.Rd | 21 +++++ man/setup_travel_eir.Rd | 31 ++++++ man/setup_travel_static.dts.Rd | 34 ------- man/setup_travel_static.xde.Rd | 34 ------- man/travel_eir.Rd | 21 +++++ man/travel_malaria.Rd | 19 ---- man/travel_malaria.dts.Rd | 19 ---- man/travel_malaria.xde.Rd | 19 ---- man/traveling.Rd | 23 +++++ man/traveling.dynamic.Rd | 21 +++++ man/traveling.setup.Rd | 21 +++++ man/traveling.static.Rd | 21 +++++ 30 files changed, 395 insertions(+), 271 deletions(-) create mode 100644 R/travel_eir.R delete mode 100644 R/travel_malaria.R create mode 100644 R/traveling.R rename man/{setup_travel_static.Rd => setup_dynamic_travel.Rd} (64%) create mode 100644 man/setup_no_travel.Rd create mode 100644 man/setup_static_travel.Rd create mode 100644 man/setup_travel_eir.Rd delete mode 100644 man/setup_travel_static.dts.Rd delete mode 100644 man/setup_travel_static.xde.Rd create mode 100644 man/travel_eir.Rd delete mode 100644 man/travel_malaria.Rd delete mode 100644 man/travel_malaria.dts.Rd delete mode 100644 man/travel_malaria.xde.Rd create mode 100644 man/traveling.Rd create mode 100644 man/traveling.dynamic.Rd create mode 100644 man/traveling.setup.Rd create mode 100644 man/traveling.static.Rd diff --git a/NAMESPACE b/NAMESPACE index 97ad8d155..df220cd12 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -311,10 +311,9 @@ S3method(setup_hydrology,func) S3method(setup_rainfall,func) S3method(setup_shock,func) S3method(setup_temperature,func) -S3method(setup_travel_static,dts) -S3method(setup_travel_static,xde) -S3method(travel_malaria,dts) -S3method(travel_malaria,xde) +S3method(traveling,dynamic) +S3method(traveling,setup) +S3method(traveling,static) S3method(trigger_setup,dynamic) S3method(trigger_setup,setup) S3method(trigger_setup,static) @@ -585,6 +584,7 @@ export(setup_births_static) export(setup_care_seeking_no_behavior) export(setup_development) export(setup_development_func) +export(setup_dynamic_travel) export(setup_eip_fixedlag_dts) export(setup_exposure_multiday) export(setup_exposure_nb) @@ -610,6 +610,7 @@ export(setup_no_school) export(setup_no_shock) export(setup_no_sugar_baits) export(setup_no_temperature) +export(setup_no_travel) export(setup_other_blood_hosts_static) export(setup_rainfall) export(setup_rainfall_func) @@ -617,14 +618,16 @@ export(setup_resources_forced) export(setup_resources_static) export(setup_shock) export(setup_shock_func) +export(setup_static_travel) export(setup_sugar_static) export(setup_temperature) export(setup_temperature_func) -export(setup_travel_static) +export(setup_travel_eir) export(setup_visitors_basic) export(setup_visitors_static) export(shapeIt) -export(travel_malaria) +export(travel_eir) +export(traveling) export(trigger_setup) export(update_Linits) export(update_MYZinits) diff --git a/R/blood_feeding.R b/R/blood_feeding.R index 5a4c1f692..6deccb1ef 100644 --- a/R/blood_feeding.R +++ b/R/blood_feeding.R @@ -283,8 +283,10 @@ compute_TaR = function(t, TiSp, F_circadian, time_traveling){ #' @export make_TaR <- function(pars, t=0){ for(s in 1:pars$nVectors) - for(i in 1:pars$nHosts) + for(i in 1:pars$nHosts){ + pars = traveling(t, pars, i) pars$TaR[[i]][[s]] = compute_TaR(t, pars$TimeSpent[[i]], pars$BFpar$F_circadian[[s]], pars$time_traveling[[i]]) + } return(pars) } diff --git a/R/exposure-multiday.R b/R/exposure-multiday.R index 84c3e3d3a..a08800bc4 100644 --- a/R/exposure-multiday.R +++ b/R/exposure-multiday.R @@ -3,7 +3,7 @@ #' @description This function translates seven days of daily entomological #' inoculation rate (dEIR) into a multiday attack rate. The daily FoI #' is the sum of two terms: 1) a function [F_foi] computes the local dFoI; -#' 2) a function [travel_malaria] that computes the FoI resulting from +#' 2) a function [travel_eir] and [traveling] #' exposure while traveling. #' @inheritParams Exposure #' @return the function modifies **pars** and returns it: the computed FoI are stored as `pars$FoI` @@ -11,10 +11,14 @@ Exposure.multiday <- function(t, y, pars){ dd = t%%pars$Xday + 1 for(i in 1:pars$nHosts){ - pars$EIR_D[[i]][dd] = pars$EIR[[i]] - b = F_b(y, pars, i) - pars$AR[[i]] = F_ar(pars$EIR_D[[i]], b, pars) + travel_malaria(t, pars) - pars$EIR_D[[i]] = 0*pars$EIR[[i]] + trv = pars$time_traveling[[i]] + travelEIR = travel_eir(t, pars, i)*pars$Xday + b = as.vector(F_b(y, pars, i)) + pars$AR[[i]] = (1-trv)*F_ar(pars$EIR[[i]]*pars$Xday, b, pars) + trv*F_ar(travelEIR, b, pars) + #pars$EIR_D[[i]][dd] = pars$EIR[[i]] + #b = F_b(y, pars, i) + #pars$AR[[i]] = F_ar(pars$EIR_D[[i]], b, pars) + F_a(t, pars) + #pars$EIR_D[[i]] = 0*pars$EIR[[i]] } return(pars) } @@ -28,3 +32,4 @@ setup_exposure_multiday <- function(pars) { pars$EIR_D <- pars$EIR return(pars) } + diff --git a/R/exposure.R b/R/exposure.R index 9a42d781e..e85b38b4e 100644 --- a/R/exposure.R +++ b/R/exposure.R @@ -7,7 +7,7 @@ #' @param y the state variables #' @param pars an **`xds`** object #' @return an **`xds`** object -#' @seealso Cases: [Exposure.xde] & [Exposure.dts]. Related: [travel_malaria] & [F_ar] & [F_foi] +#' @seealso Cases: [Exposure.xde] & [Exposure.dts]. Related: [F_ar] & [F_foi] #' @export Exposure <- function(t, y, pars){ UseMethod("Exposure", pars$xds) @@ -23,17 +23,19 @@ Exposure <- function(t, y, pars){ #' per infectious bite, \eqn{b} (called from \eqn{F_b}, #' as defined by an \eqn{\cal X} model). #' The total FoI is a weighted sum of the local FoI and -#' exposure to malaria while traveling, (\eqn{T_h}): -#' \deqn{h = (1-\delta) \; F_h(E, b) + \delta\; T_h(b,t)} +#' exposure to malaria while traveling, +#' computed from the the travel EIR, \eqn{E_T}: +#' \deqn{h = (1-\delta) \; F_h(E, b) + \delta\; F_h(E_T, b,t)} #' @inheritParams Exposure -#' @seealso Related: [Exposure] & [F_foi.pois] & [F_foi.nb] & [travel_malaria] +#' @seealso Related: [Exposure] & [F_foi.pois] & [F_foi.nb] & [travel_eir] & [traveling] #' @return an **`xds`** object #' @export Exposure.xde <- function(t, y, pars){ for(i in 1:pars$nHosts){ trv = pars$time_traveling[[i]] + travelEIR = travel_eir(t, pars, i) b = as.vector(F_b(y, pars, i)) - pars$FoI[[i]] = (1-trv)*F_foi(pars$EIR[[i]], b, pars) + trv*travel_malaria(t, pars) + pars$FoI[[i]] = (1-trv)*F_foi(pars$EIR[[i]], b, pars) + trv*F_foi(travelEIR, b, pars) } return(pars) } @@ -54,13 +56,14 @@ Exposure.xde <- function(t, y, pars){ #' \deqn{\alpha = (1-\delta) \; F_\alpha(E, b) + \delta\; T_\alpha(b)} #' @inheritParams Exposure #' @return an **`xds`** object -#' @seealso Related: [Exposure] & [F_ar.pois] & [F_ar.nb] & [travel_malaria] +#' @seealso Related: [Exposure] & [F_ar.pois] & [F_ar.nb] & [travel_eir] & [traveling] #' @export Exposure.dts <- function(t, y, pars){ for(i in 1:pars$nHosts){ trv = pars$time_traveling[[i]] + travelEIR = travel_eir(t, pars, i)*pars$Xday b = as.vector(F_b(y, pars, i)) - pars$AR[[i]] = (1-trv)*F_ar(pars$EIR[[i]]*pars$Xday, b, pars) + trv*travel_malaria(t, pars) + pars$AR[[i]] = (1-trv)*F_ar(pars$EIR[[i]]*pars$Xday, b, pars) + trv*F_ar(travelEIR, b, pars) } return(pars) } diff --git a/R/travel_eir.R b/R/travel_eir.R new file mode 100644 index 000000000..94239502f --- /dev/null +++ b/R/travel_eir.R @@ -0,0 +1,30 @@ + +#' @title Travel EIR +#' @description Compute the EIR while traveling +#' @param t the time +#' @param pars an **`xds`** object +#' @param i the host species index +#' @return the daily travel EIR, a [numeric] vector +#' @export +travel_eir <- function(t, pars, i){ + with(pars$travel_eir[[i]], return(travelEIR*F_season(t)*F_trend(t))) +} + +#' @title Setup Travel EIR +#' @description Set up a function to compute the travel EIR +#' @param pars a [list] +#' @param travelEIR the time spent traveling +#' @param F_season a function describing a seasonal pattern +#' @param F_trend a function describing a trend +#' @param i the host species index +#' @return an **`xds`** object +#' @export +setup_travel_eir = function(pars, travelEIR=0, F_season=F_flat, F_trend=F_flat, i=1){ + trv <- list() + trv$travelEIR <- travelEIR + trv$F_season <- F_season + trv$F_trend <- F_trend + pars$travel_eir[[i]] <- trv + return(pars) +} + diff --git a/R/travel_malaria.R b/R/travel_malaria.R deleted file mode 100644 index c9b643b66..000000000 --- a/R/travel_malaria.R +++ /dev/null @@ -1,83 +0,0 @@ -# generic methods for a model of travel malaria - -#' @title Simulate travel malaria -#' @description This method dispatches on the type of `pars$TRAVEL`. -#' @param t current simulation time -#' @param pars a [list] -#' @return the travel FoI, a [numeric] value -#' @export -travel_malaria <- function(t, pars) { - UseMethod("travel_malaria", pars$xds) -} - -#' @title A model for the travel FoI -#' @description Implements [travel_malaria] through a model for the travel FoI -#' @inheritParams travel_malaria -#' @return a [numeric] -#' @export -travel_malaria.xde <- function(t, pars) { - with(pars$TRAVEL,{ - travel_foi = delta*F_season(t)*F_trend(t) - return(travel_foi) - }) -} - -#' @title A model for the travel FoI -#' @description Implements [travel_malaria] through a model for the travel FoI -#' @inheritParams travel_malaria -#' @return a [numeric] -#' @export -travel_malaria.dts <- function(t, pars) { - with(pars$TRAVEL,{ - travel_ar = delta*F_season(t)*F_trend(t) - return(travel_ar) - }) -} - -#' @title A function to set up malaria importation -#' @description Setup a static model for travel malaria -#' @param pars a [list] -#' @param time_traveling the time spent traveling -#' @param delta the travel FoI -#' @param F_season a function describing a seasonal pattern -#' @param F_trend a function describing a trend -#' @param i the host species index -#' @return a [list] -#' @export -setup_travel_static = function(pars, time_traveling=0, delta=0, - F_season=F_flat, F_trend=F_flat, i=1){ - UseMethod("setup_travel_static", pars$xds) -} - -#' @title A function to set up malaria importation -#' @description Setup a static model for travel malaria -#' @inheritParams setup_travel_static -#' @return a [list] -#' @export -setup_travel_static.xde = function(pars, time_traveling=0, delta=0, - F_season=F_flat, F_trend=F_flat, i=1){ - TRAVEL <- list() - class(TRAVEL) <- 'static' - pars$TRAVEL <- TRAVEL - pars$time_traveling[[i]] = rep(time_traveling, pars$nStrata[i]) - pars$TRAVEL$delta = rep(delta, pars$nStrata[i]) - pars$TRAVEL$F_season = F_season - pars$TRAVEL$F_trend = F_trend - return(pars) -} - -#' @title A function to set up malaria importation -#' @description Setup a static model for travel malaria -#' @inheritParams setup_travel_static -#' @return a [list] -#' @export -setup_travel_static.dts = function(pars, time_traveling=0, delta=0, - F_season = F_flat, F_trend=F_flat, i=1){ - TRAVEL <- list() - class(TRAVEL) <- 'static' - pars$time_traveling[[i]] = rep(time_traveling, pars$nStrata[i]) - pars$TRAVEL$delta = rep(delta, pars$nStrata[i]) - pars$TRAVEL$F_season = F_season - pars$TRAVEL$F_trend = F_trend - return(pars) -} diff --git a/R/traveling.R b/R/traveling.R new file mode 100644 index 000000000..288efd877 --- /dev/null +++ b/R/traveling.R @@ -0,0 +1,94 @@ + +#' @title A model for the travel FoI +#' @description Implements [traveling]. The function is +#' called by [make_TaR] to set the fraction of time spent +#' traveling +#' @param t current simulation time +#' @param pars a [list]# +#' @param i host species index +#' @return an **`xds`** object +#' @export +traveling <- function(t, pars, i) { + UseMethod("traveling", pars$travel[[i]]) +} + +#' @title A model for the travel FoI +#' @description Implements [traveling] through a model for the travel FoI +#' @inheritParams traveling +#' @return an **`xds`** object +#' @export +traveling.static <- function(t, pars, i) { + return(pars) +} + +#' @title A model for the travel FoI +#' @description Implements [traveling] through a model for the travel FoI +#' @inheritParams traveling +#' @return an **`xds`** object +#' @export +traveling.setup <- function(t, pars, i) { + pars$time_traveling[[i]] <- pars$travel[[i]]$traveling_fraction + pars <- trigger_setup(pars$BFpar) + return(pars) +} + +#' @title A model for the travel FoI +#' @description Implements [traveling] through a model for the travel FoI +#' @inheritParams traveling +#' @return an **`xds`** object +#' @export +traveling.dynamic <- function(t, pars, i) { + with(pars$travel[[i]],{ + pars$time_traveling[[i]] = traveling*F_season(t)*F_trend(t) + return(pars) + }) +} + +#' @title A function to set up malaria importation +#' @description Setup a static model for travel malaria +#' @param pars a [list] +#' @param i the host species index +#' @return a [list] +#' @export +setup_no_travel = function(pars, i=1){ + trv <- list() + class(trv) <- "static" + trv$traveling_fraction <- 0 + pars$travel[[i]] <- trv + return(pars) +} + +#' @title A function to set up malaria importation +#' @description Setup a static model for travel malaria +#' @param pars an **`xds`** object +#' @param traveling_fraction the fraction of time spent traveling +#' @param i the host species index +#' @return a [list] +#' @export +setup_static_travel = function(pars, traveling_fraction=0, i=1){ + trv <- list() + class(trv) <- "setup" + trv$traveling_fraction <- traveling_fraction + pars$travel[[i]] <- trv + return(pars) +} + +#' @title A function to set up malaria importation +#' @description Setup a static model for travel malaria +#' @param pars a [list] +#' @param traveling the time spent traveling +#' @param F_season a function describing a seasonal pattern +#' @param F_trend a function describing a trend +#' @param i the host species index +#' @return a [list] +#' @export +setup_dynamic_travel = function(pars, traveling=0, F_season=F_flat, F_trend=F_flat, i=1){ + trv <- list() + class(trv) <- "dynamic" + class(pars$BFpar) <- "dynamic" + trv$traveling <- traveling + trv$F_season <- F_season + trv$F_trend <- F_trend + pars$travel[[i]] <- trv + return(pars) +} diff --git a/R/xds-template.R b/R/xds-template.R index ae2487c13..658891598 100644 --- a/R/xds-template.R +++ b/R/xds-template.R @@ -45,7 +45,7 @@ #' - [Exposure] is called *after* [Transmission] to compute environmentally heterogeneous exposure #' and malaria importation through travel: #' - [setup_exposure_pois] sets up a Poisson model for environmental heterogeneity -#' - [setup_travel_static] sets up a model with no exposure through travel +#' - [setup_no_travel] sets up a model with no exposure through travel #' #' @param xds is used to dispatch various functions to set up and solve systems of differential equations. 'xde' for ordinary or delay differential equations; 'dts' for "discrete time systems" #' @param frame model component subset @@ -103,7 +103,10 @@ make_xds_template = function(xds='ode', frame='full', pars <- setup_TRANSMISSION(pars) pars <- setup_exposure_pois(pars) - pars <- setup_travel_static(pars) + pars$travel <- list() + pars <- setup_no_travel(pars, 1) + pars$travel_eir <- list() + pars <- setup_travel_eir(pars, 1) pars$Linits = list() pars$MYZinits = list() diff --git a/_pkgdown.yml b/_pkgdown.yml index 766ffb7f6..6c176dabc 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -696,19 +696,22 @@ reference: - setup_care_seeking_no_behavior - title: Imported Malaria desc: | - Methods to implement imported malaria - contents: - - travel_malaria + Methods to implement time spent traveling + contents: + - traveling + - traveling.static + - traveling.setup + - traveling.dynamic + - setup_no_travel + - setup_static_travel + - setup_dynamic_travel - Visiting - subtitle: Travel Malaria desc: | Specialized methods for travel malaria contents: - - travel_malaria.xde - - travel_malaria.dts - - setup_travel_static - - setup_travel_static.xde - - setup_travel_static.dts + - travel_eir + - setup_travel_eir - subtitle: Visiting desc: | Methods for the availability and infectiousness of a visitor population diff --git a/docs/reference/Exposure.xde.html b/docs/reference/Exposure.xde.html index 48ba9bb68..3bc498fac 100644 --- a/docs/reference/Exposure.xde.html +++ b/docs/reference/Exposure.xde.html @@ -162,12 +162,13 @@

Details

per infectious bite, \(b\) (called from \(F_b\), as defined by an \(\cal X\) model). The total FoI is a weighted sum of the local FoI and -exposure to malaria while traveling, (\(T_h\)): -$$h = (1-\delta) \; F_h(E, b) + \delta\; T_h(b,t)$$

+exposure to malaria while traveling, +computed from the the travel EIR, \(E_T\): +$$h = (1-\delta) \; F_h(E, b) + \delta\; F_h(E_T, b,t)$$

See also

- +

Related: Exposure & F_foi.pois & F_foi.nb & travel_eir & time_traveling

diff --git a/docs/reference/index.html b/docs/reference/index.html index 45b6a204f..822058ed0 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -2204,40 +2204,52 @@

Care Seeking

Make parameters for the no_behavior model for care seeking (do nothing)

Imported Malaria

-

Methods to implement imported malaria

+

Methods to implement time spent traveling

-

travel_malaria()

+

traveling()

-

Simulate travel malaria

+

A model for the travel FoI

-

Visiting()

+

traveling(<static>)

-

Visiting

- -

Travel Malaria

-

Specialized methods for travel malaria

- - -

travel_malaria(<xde>)

+

A model for the travel FoI

+ +

traveling(<setup>)

A model for the travel FoI

-

travel_malaria(<dts>)

+

traveling(<dynamic>)

A model for the travel FoI

-

setup_travel_static()

+

setup_no_travel()

A function to set up malaria importation

-

setup_travel_static(<xde>)

+

setup_static_travel()

A function to set up malaria importation

-

setup_travel_static(<dts>)

+

setup_dynamic_travel()

A function to set up malaria importation

+ +

Visiting()

+ +

Visiting

+ +

Travel Malaria

+

Specialized methods for travel malaria

+ + +

travel_eir()

+ +

A model for the travel FoI

+ +

setup_travel_eir()

+ +

A function to set up the travel eir

Visiting

Methods for the availability and infectiousness of a visitor population

diff --git a/man/Exposure.Rd b/man/Exposure.Rd index 99197383f..8eec0b2ab 100644 --- a/man/Exposure.Rd +++ b/man/Exposure.Rd @@ -23,5 +23,5 @@ daily entomological inoculation rate (dEIR), immunity, and exposure to malaria while traveling. } \seealso{ -Cases: \link{Exposure.xde} & \link{Exposure.dts}. Related: \link{travel_malaria} & \link{F_ar} & \link{F_foi} +Cases: \link{Exposure.xde} & \link{Exposure.dts}. Related: \link{F_ar} & \link{F_foi} } diff --git a/man/Exposure.dts.Rd b/man/Exposure.dts.Rd index 63ba5f338..e7e0294e0 100644 --- a/man/Exposure.dts.Rd +++ b/man/Exposure.dts.Rd @@ -33,5 +33,5 @@ exposure to malaria while traveling, (\eqn{T_\delta}): \deqn{\alpha = (1-\delta) \; F_\alpha(E, b) + \delta\; T_\alpha(b)} } \seealso{ -Related: \link{Exposure} & \link{F_ar.pois} & \link{F_ar.nb} & \link{travel_malaria} +Related: \link{Exposure} & \link{F_ar.pois} & \link{F_ar.nb} & \link{travel_eir} & \link{traveling} } diff --git a/man/Exposure.multiday.Rd b/man/Exposure.multiday.Rd index dce5ab5ed..c746d596b 100644 --- a/man/Exposure.multiday.Rd +++ b/man/Exposure.multiday.Rd @@ -20,6 +20,6 @@ the function modifies \strong{pars} and returns it: the computed FoI are stored This function translates seven days of daily entomological inoculation rate (dEIR) into a multiday attack rate. The daily FoI is the sum of two terms: 1) a function \link{F_foi} computes the local dFoI; -2) a function \link{travel_malaria} that computes the FoI resulting from +2) a function \link{travel_eir} and \link{traveling} exposure while traveling. } diff --git a/man/Exposure.xde.Rd b/man/Exposure.xde.Rd index 0b0887487..2af8ef143 100644 --- a/man/Exposure.xde.Rd +++ b/man/Exposure.xde.Rd @@ -27,9 +27,10 @@ a model for the probability of infection per infectious bite, \eqn{b} (called from \eqn{F_b}, as defined by an \eqn{\cal X} model). The total FoI is a weighted sum of the local FoI and -exposure to malaria while traveling, (\eqn{T_h}): -\deqn{h = (1-\delta) \; F_h(E, b) + \delta\; T_h(b,t)} +exposure to malaria while traveling, +computed from the the travel EIR, \eqn{E_T}: +\deqn{h = (1-\delta) \; F_h(E, b) + \delta\; F_h(E_T, b,t)} } \seealso{ -Related: \link{Exposure} & \link{F_foi.pois} & \link{F_foi.nb} & \link{travel_malaria} +Related: \link{Exposure} & \link{F_foi.pois} & \link{F_foi.nb} & \link{travel_eir} & \link{traveling} } diff --git a/man/make_xds_template.Rd b/man/make_xds_template.Rd index dfa32061c..3e9ebb66e 100644 --- a/man/make_xds_template.Rd +++ b/man/make_xds_template.Rd @@ -85,7 +85,7 @@ Finally, the function sets up a few other miscellaneous options: and malaria importation through travel: \itemize{ \item \link{setup_exposure_pois} sets up a Poisson model for environmental heterogeneity -\item \link{setup_travel_static} sets up a model with no exposure through travel +\item \link{setup_no_travel} sets up a model with no exposure through travel } } } diff --git a/man/setup_travel_static.Rd b/man/setup_dynamic_travel.Rd similarity index 64% rename from man/setup_travel_static.Rd rename to man/setup_dynamic_travel.Rd index 43ca99ede..62c4523d5 100644 --- a/man/setup_travel_static.Rd +++ b/man/setup_dynamic_travel.Rd @@ -1,13 +1,12 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/travel_malaria.R -\name{setup_travel_static} -\alias{setup_travel_static} +% Please edit documentation in R/traveling.R +\name{setup_dynamic_travel} +\alias{setup_dynamic_travel} \title{A function to set up malaria importation} \usage{ -setup_travel_static( +setup_dynamic_travel( pars, - time_traveling = 0, - delta = 0, + traveling = 0, F_season = F_flat, F_trend = F_flat, i = 1 @@ -16,9 +15,7 @@ setup_travel_static( \arguments{ \item{pars}{a \link{list}} -\item{time_traveling}{the time spent traveling} - -\item{delta}{the travel FoI} +\item{traveling}{the time spent traveling} \item{F_season}{a function describing a seasonal pattern} diff --git a/man/setup_no_travel.Rd b/man/setup_no_travel.Rd new file mode 100644 index 000000000..61ca20500 --- /dev/null +++ b/man/setup_no_travel.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/traveling.R +\name{setup_no_travel} +\alias{setup_no_travel} +\title{A function to set up malaria importation} +\usage{ +setup_no_travel(pars, i = 1) +} +\arguments{ +\item{pars}{a \link{list}} + +\item{i}{the host species index} +} +\value{ +a \link{list} +} +\description{ +Setup a static model for travel malaria +} diff --git a/man/setup_static_travel.Rd b/man/setup_static_travel.Rd new file mode 100644 index 000000000..db35fedbc --- /dev/null +++ b/man/setup_static_travel.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/traveling.R +\name{setup_static_travel} +\alias{setup_static_travel} +\title{A function to set up malaria importation} +\usage{ +setup_static_travel(pars, traveling_fraction = 0, i = 1) +} +\arguments{ +\item{pars}{an \strong{\code{xds}} object} + +\item{traveling_fraction}{the fraction of time spent traveling} + +\item{i}{the host species index} +} +\value{ +a \link{list} +} +\description{ +Setup a static model for travel malaria +} diff --git a/man/setup_travel_eir.Rd b/man/setup_travel_eir.Rd new file mode 100644 index 000000000..898ee4bb4 --- /dev/null +++ b/man/setup_travel_eir.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/travel_eir.R +\name{setup_travel_eir} +\alias{setup_travel_eir} +\title{Setup Travel EIR} +\usage{ +setup_travel_eir( + pars, + travelEIR = 0, + F_season = F_flat, + F_trend = F_flat, + i = 1 +) +} +\arguments{ +\item{pars}{a \link{list}} + +\item{travelEIR}{the time spent traveling} + +\item{F_season}{a function describing a seasonal pattern} + +\item{F_trend}{a function describing a trend} + +\item{i}{the host species index} +} +\value{ +an \strong{\code{xds}} object +} +\description{ +Set up a function to compute the travel EIR +} diff --git a/man/setup_travel_static.dts.Rd b/man/setup_travel_static.dts.Rd deleted file mode 100644 index 5878d53cb..000000000 --- a/man/setup_travel_static.dts.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/travel_malaria.R -\name{setup_travel_static.dts} -\alias{setup_travel_static.dts} -\title{A function to set up malaria importation} -\usage{ -\method{setup_travel_static}{dts}( - pars, - time_traveling = 0, - delta = 0, - F_season = F_flat, - F_trend = F_flat, - i = 1 -) -} -\arguments{ -\item{pars}{a \link{list}} - -\item{time_traveling}{the time spent traveling} - -\item{delta}{the travel FoI} - -\item{F_season}{a function describing a seasonal pattern} - -\item{F_trend}{a function describing a trend} - -\item{i}{the host species index} -} -\value{ -a \link{list} -} -\description{ -Setup a static model for travel malaria -} diff --git a/man/setup_travel_static.xde.Rd b/man/setup_travel_static.xde.Rd deleted file mode 100644 index af579f5a4..000000000 --- a/man/setup_travel_static.xde.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/travel_malaria.R -\name{setup_travel_static.xde} -\alias{setup_travel_static.xde} -\title{A function to set up malaria importation} -\usage{ -\method{setup_travel_static}{xde}( - pars, - time_traveling = 0, - delta = 0, - F_season = F_flat, - F_trend = F_flat, - i = 1 -) -} -\arguments{ -\item{pars}{a \link{list}} - -\item{time_traveling}{the time spent traveling} - -\item{delta}{the travel FoI} - -\item{F_season}{a function describing a seasonal pattern} - -\item{F_trend}{a function describing a trend} - -\item{i}{the host species index} -} -\value{ -a \link{list} -} -\description{ -Setup a static model for travel malaria -} diff --git a/man/travel_eir.Rd b/man/travel_eir.Rd new file mode 100644 index 000000000..38bcf29f9 --- /dev/null +++ b/man/travel_eir.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/travel_eir.R +\name{travel_eir} +\alias{travel_eir} +\title{Travel EIR} +\usage{ +travel_eir(t, pars, i) +} +\arguments{ +\item{t}{the time} + +\item{pars}{an \strong{\code{xds}} object} + +\item{i}{the host species index} +} +\value{ +the daily travel EIR, a \link{numeric} vector +} +\description{ +Compute the EIR while traveling +} diff --git a/man/travel_malaria.Rd b/man/travel_malaria.Rd deleted file mode 100644 index 54b1374d5..000000000 --- a/man/travel_malaria.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/travel_malaria.R -\name{travel_malaria} -\alias{travel_malaria} -\title{Simulate travel malaria} -\usage{ -travel_malaria(t, pars) -} -\arguments{ -\item{t}{current simulation time} - -\item{pars}{a \link{list}} -} -\value{ -the travel FoI, a \link{numeric} value -} -\description{ -This method dispatches on the type of \code{pars$TRAVEL}. -} diff --git a/man/travel_malaria.dts.Rd b/man/travel_malaria.dts.Rd deleted file mode 100644 index ad43e13a0..000000000 --- a/man/travel_malaria.dts.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/travel_malaria.R -\name{travel_malaria.dts} -\alias{travel_malaria.dts} -\title{A model for the travel FoI} -\usage{ -\method{travel_malaria}{dts}(t, pars) -} -\arguments{ -\item{t}{current simulation time} - -\item{pars}{a \link{list}} -} -\value{ -a \link{numeric} -} -\description{ -Implements \link{travel_malaria} through a model for the travel FoI -} diff --git a/man/travel_malaria.xde.Rd b/man/travel_malaria.xde.Rd deleted file mode 100644 index 950084ab9..000000000 --- a/man/travel_malaria.xde.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/travel_malaria.R -\name{travel_malaria.xde} -\alias{travel_malaria.xde} -\title{A model for the travel FoI} -\usage{ -\method{travel_malaria}{xde}(t, pars) -} -\arguments{ -\item{t}{current simulation time} - -\item{pars}{a \link{list}} -} -\value{ -a \link{numeric} -} -\description{ -Implements \link{travel_malaria} through a model for the travel FoI -} diff --git a/man/traveling.Rd b/man/traveling.Rd new file mode 100644 index 000000000..c4da16ec1 --- /dev/null +++ b/man/traveling.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/traveling.R +\name{traveling} +\alias{traveling} +\title{A model for the travel FoI} +\usage{ +traveling(t, pars, i) +} +\arguments{ +\item{t}{current simulation time} + +\item{pars}{a \link{list}#} + +\item{i}{host species index} +} +\value{ +an \strong{\code{xds}} object +} +\description{ +Implements \link{traveling}. The function is +called by \link{make_TaR} to set the fraction of time spent +traveling +} diff --git a/man/traveling.dynamic.Rd b/man/traveling.dynamic.Rd new file mode 100644 index 000000000..c53a72407 --- /dev/null +++ b/man/traveling.dynamic.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/traveling.R +\name{traveling.dynamic} +\alias{traveling.dynamic} +\title{A model for the travel FoI} +\usage{ +\method{traveling}{dynamic}(t, pars, i) +} +\arguments{ +\item{t}{current simulation time} + +\item{pars}{a \link{list}#} + +\item{i}{host species index} +} +\value{ +an \strong{\code{xds}} object +} +\description{ +Implements \link{traveling} through a model for the travel FoI +} diff --git a/man/traveling.setup.Rd b/man/traveling.setup.Rd new file mode 100644 index 000000000..180c96bb4 --- /dev/null +++ b/man/traveling.setup.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/traveling.R +\name{traveling.setup} +\alias{traveling.setup} +\title{A model for the travel FoI} +\usage{ +\method{traveling}{setup}(t, pars, i) +} +\arguments{ +\item{t}{current simulation time} + +\item{pars}{a \link{list}#} + +\item{i}{host species index} +} +\value{ +an \strong{\code{xds}} object +} +\description{ +Implements \link{traveling} through a model for the travel FoI +} diff --git a/man/traveling.static.Rd b/man/traveling.static.Rd new file mode 100644 index 000000000..54a0e6bae --- /dev/null +++ b/man/traveling.static.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/traveling.R +\name{traveling.static} +\alias{traveling.static} +\title{A model for the travel FoI} +\usage{ +\method{traveling}{static}(t, pars, i) +} +\arguments{ +\item{t}{current simulation time} + +\item{pars}{a \link{list}#} + +\item{i}{host species index} +} +\value{ +an \strong{\code{xds}} object +} +\description{ +Implements \link{traveling} through a model for the travel FoI +}