Modular functions for the population simulator for performing dispersal of stage abundance at a specified time step via dispersal rates provided.
population_dispersal(
replicates,
time_steps,
years_per_step,
populations,
demographic_stochasticity,
density_stages,
dispersal,
dispersal_stages,
dispersal_source_n_k,
dispersal_target_k,
dispersal_target_n,
dispersal_target_n_k = NULL,
simulator
)Dispersal function: function(r, tm, carrying_capacity, stage_abundance, occupied_indices), where:
rSimulation replicate.
tmSimulation time step.
carrying_capacityArray of carrying capacity values for each population at time step.
stage_abundanceMatrix of abundance for each stage (rows) and population (columns) at time step.
occupied_indicesArray of indices for populations occupied at time step.
returnsNew stage abundance matrix with dispersal applied.
Number of replicate simulation runs.
Number of simulation time steps.
Number of years per time step.
Number of populations.
Boolean for optionally choosing demographic stochasticity for the transformation.
Array of booleans or numeric (0,1) for each stage to indicate which stages are affected by density.
Either a matrix 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 optional changing rates over time (as per class DispersalGenerator dispersal_data attribute). Alternatively a user-defined function (optionally nested in a list with additional attributes) 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.
years_per_stepNumber of years per time step.
populationsNumber of populations.
stagesNumber of life cycle stages.
demographic_stochasticityBoolean for optionally choosing demographic stochasticity for the transformation.
density_stagesArray of booleans or numeric (0,1) for each stage to indicate which stages are affected by density.
dispersal_stagesArray of relative dispersal (0-1) for each stage to indicate the degree to which each stage participates in dispersal.
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 visa-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 visa-versa.
rSimulation replicate.
tmSimulation time step.
carrying_capacityArray of carrying capacity values for each population at time step.
stage_abundanceMatrix of abundance for each stage (rows) and population (columns) at time step.
occupied_indicesArray of indices for populations occupied at time step.
simulatorSimulatorReference object with dynamically accessible attached and results lists.
additional attributesAdditional attributes when the transformation is optionally nested in a list.
returns the post-dispersal abundance matrix
Array of relative dispersal (0-1) for each stage to indicate the degree to which each stage participates in dispersal (default is 1 for all stages).
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 visa-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 visa-versa.
SimulatorReference object with dynamically accessible attached and results lists.