simulation_results: Run a simulation

Description Usage Arguments Value Examples

Description

A simulation changes landscape objects based on selected dynamics over a specified number of timesteps.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
simulation(landscape, population_dynamics, habitat_dynamics = list(),
  demo_stochasticity = c("full", "deterministic_redistribution",
  "stochastic_redistribution", "none"), timesteps = 3, replicates = 1,
  verbose = TRUE)

is.simulation_results(x)

## S3 method for class 'simulation_results'
plot(x, object = "population",
  type = "graph", stages = NULL, animate = FALSE,
  timesteps = c(1:3), panels = c(3, 3), emp = FALSE, ...)

extract_spatial(x, replicate = 1, timestep = 1,
  landscape_object = "population", stage = 1, misc = 1)

Arguments

landscape

a landscape object representing the initial habitat and population

population_dynamics

a population_dynamics object describing how population changes over time

habitat_dynamics

optional list of functions to modify the landscape at each timestep - see habitat_dynamics_functions

demo_stochasticity

how should population rounding occur, if at all - "full" uses a multinomial draw to return rounded cell populations (default); "deterministic_redistribution" redistributes the decimal overages to the cells with the largest overages; "stochastic_redistribution" redistributes the decimal overages to the cells based on binomial draws using the overages as probabilities; "none" returns non-integer cell populations (no rounding). Note, this parameter specification is used consistently throughout all functions in a simulation.

timesteps

number of timesteps used in one simulation or timesteps to display when plotting rasters

replicates

number of simulations to perform

verbose

print messages and progress to console? (default is TRUE)

x

a simulation_results object

object

the simulation_results object to plot - can be 'population' (default), 'suitability' or 'carrying_capacity'

type

the plot type - 'graph' (default) or 'raster'

stages

life-stages to plot - must be specified for 'raster' plot types; by default all life-stages will be plotted

animate

if plotting type 'raster' would you like to animate the rasters?

panels

the number of columns and rows to use when plotting raster timeseries - default is 3 x 3 (e.g. c(3,3) )

emp

should the expected minimum population of the simulation be plotted?

...

further arguments passed to or from other methods

replicate

which replicate to extract from a simulation_results object

timestep

which timestep(s) to extract from a simulation_results object

landscape_object

which landscape object to extract from a simulation_results object - can be specified by name (e.g. "suitability") or index number

stage

which life-stage to extract from a simulation_results object - only used for 'population' components of the landscape object

misc

which misc object to extract from a simulation_results object - only used for additional spatial objects added to a landscape (e.g. disturbance layers)

Value

An object of class simulation_results

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(steps)
library(raster)
library(future)
plan(sequential)

landscape <- landscape(population = egk_pop,
               suitability = egk_hab,
               carrying_capacity = egk_k)

pop_dynamics <- population_dynamics(change = growth(transition_matrix = egk_mat))

results <- simulation(landscape, pop_dynamics, timesteps = 10, replicates = 3)

# Test if object is of the type 'simulation_results'

is.simulation_results(results)

plot(results)

# Extract spatial components from a 'simulation_results' object

extract_spatial(results)

steps documentation built on May 2, 2019, 9:41 a.m.