Modular functions for the disease simulator for performing dispersal of segment (stage by compartment) abundance at a specified time step via dispersal rates provided. Dispersal can be handled identically for all stages and compartments, or can be handled differently by stage, compartment, or both.
disease_dispersal(
replicates,
time_steps,
populations,
demographic_stochasticity,
dispersal,
dispersal_type,
dispersal_source_n_k = NULL,
dispersal_target_k = NULL,
dispersal_target_n = NULL,
dispersal_target_n_k = NULL,
stages = NULL,
compartments = NULL,
simulator
)Dispersal function: function(r, tm, carrying_capacity,
segment_abundance), where:
rSimulation replicate.
tmSimulation time step.
carrying_capacityArray of carrying capacity values for each population at time step.
segment_abundanceMatrix of abundance for each stage by compartment (rows) and population (columns) at time step.
returnsNew stage abundance matrix with dispersal applied.
Number of replicate simulation runs.
Number of simulation time steps.
Number of populations.
Boolean for optionally choosing demographic stochasticity for the transformation.
Must be a list. Either a list of matrices of dispersal rates
between populations (source columns to target rows) or a list of data
frames of non-zero dispersal rates and indices for constructing a compact
dispersal matrix, and optionally a list of lists of data frames showing
changing rates over time (as per class poems::DispersalGenerator
dispersal_data attribute). Alternatively a list of user-defined
functions may be used: function(params), where params is a
list passed to the function containing:
replicatesNumber of replicate simulation runs.
time_stepsNumber of simulation time steps.
populationsNumber of populations.
stagesNumber of life cycle stages.
compartmentsNumber of disease compartments.
dispersal_typeMust be "pooled", "stages", "compartments", or "segments". This indicates whether dispersal should be handled differently by stage and/or compartment.
demographic_stochasticityBoolean for optionally choosing demographic stochasticity for the transformation.
dispersal_source_n_kDispersal proportion (p) density dependence via source population abundance divided by carrying capacity (n/k), where p is reduced via a linear slope (defined by two list items) from n/k <= cutoff (p = 0) to n/k >= threshold.
dispersal_target_kDispersal rate (r) density dependence via target population carrying capacity (k), where r is reduced via a linear slope (through the origin) when k <= threshold.
dispersal_target_nDispersal rate (r) density dependence via target population abundance (n), where r is reduced via a linear slope (defined by two list items) from n >= threshold to n <= cutoff (r = 0) or vice versa.
dispersal_target_n_kDispersal rate (r) density dependence via target population abundance divided by carrying capacity (n/k), where r is reduced via a linear slope (defined by two list items) from n/k >= threshold to n/k <= cutoff (r = 0) or vice versa.
rSimulation replicate.
tmSimulation time step.
carrying_capacityArray of carrying capacity values for each population at time step.
segment_abundanceMatrix of abundance for each stage by compartment (rows) and population (columns) at time step.
simulatorpoems::SimulatorReference object with dynamically accessible attached and results lists.
returns the post-dispersal abundance matrix
Must be "pooled", "stages", "compartments", or "segments". This indicates whether dispersal should be handled differently by stage and/or compartment.
Dispersal proportion (p) density dependence via source population abundance divided by carrying capacity (n/k), where p is reduced via a linear slope (defined by two list items) from n/k <= cutoff (p = 0) to n/k >= threshold or vice versa.
Dispersal rate (r) density dependence via target population carrying capacity (k), where r is reduced via a linear slope (through the origin) when k <= threshold.
Dispersal rate (r) density dependence via target population abundance (n), where r is reduced via a linear slope (defined by two list items) from n >= threshold to n <= cutoff (r = 0) or visa-versa.
Dispersal rate (r) density dependence via target population abundance divided by carrying capacity (n/k), where r is reduced via a linear slope (defined by two list items) from n/k >= threshold to n/k <= cutoff (r = 0) or vice versa.
Number of life cycle stages.
Number of disease compartments.
poems::SimulatorReference object with dynamically
accessible attached and results lists.