Modular functions for the population simulator for performing a transformation of the stage abundance (and optionally carrying capacity) at a specified time step via a user-defined function.
population_transformation(
replicates,
time_steps,
years_per_step,
populations,
demographic_stochasticity,
density_stages,
transformation,
simulator,
name = "transformation"
)Abundance (and capacity) transformation 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.
returnsList with transformed stage abundance matrix (and optionally carrying capacity).
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.
A user-defined function (optionally nested in a list with additional attributes) for performing transformation: 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.
rSimulation replicate.
tmSimulation time step.
carrying_capacityArray of carrying capacity values for each population at time step.
stage_abundanceMatrix of (current) abundance for each stage (rows) and population (columns) at time step.
occupied_indicesArray of indices for populations occupied at (current) time step.
simulatorSimulatorReference object with dynamically accessible attached and results lists.
additional attributesAdditional attributes when the transformation is optionally nested in a list.
returns a transformed stage abundance matrix (or a list with stage abundance and carrying capacity)
SimulatorReference object with dynamically accessible attached and results lists.
Optional name for the transformation (default is "transformation").