sim_movement_prob: Simulate movement probabilistically

Description Usage Arguments Value

View source: R/move_prob.R

Description

Simulate movement probabilistically

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
sim_movement_prob(
  dist_m,
  angle = NULL,
  dispersal_fun,
  x0,
  y0,
  x_topl,
  y_topl,
  res_m,
  ncols,
  nrows,
  ncells,
  cells_block,
  cells_out_bounds,
  path,
  leave_bounds,
  allow_invalid,
  max_tries,
  sequential,
  weights = NULL,
  params
)

Arguments

angle

NULL, dummy to match sim_movement_continuous

dispersal_fun

function with a single parameter, n, which will draw distances for each individual to move in meters

x_topl

numeric, the top left x coordinate of the grid on which movement is being simulated

y_topl

numeric, the top left y coordinate of the grid on which movement is being simulated

res_m

numeric, the grid cell resolution in meters

ncols

numeric, the number of columns in the grid

nrows

numeric, the number of rows in the grid

ncells

numeric, the number of total cells (ncol * nrow)

cells_block

integer vector, the cell ids of grid cells where movements are invalid to, for use with max_tries @param cells_out_bounds integer vector, the cell ids of grid cells which are outside the bounds/ not covered by the area being simulated

leave_bounds

boolean, are movements to outside of the boundaries of the are being simulated are valid

allow_invalid

boolean, are movements to empty patches (i.e. with no dogs or bodies of water, etc.) valid

max_tries

integer, the maximum number of tries to make before accepting an invalid movement (i.e. transmission event fails due to either leaving the bounds of the simulation or moving to an uninhabitable grid cell) if either or both leave_bounds and allow_invalid are FALSE.

sequential

boolean, if TRUE then movements are sequential, if FALSE, then movements are kernel based

weights

numeric vector, weights to give each grid cell for sampling moves for use with sim_movement_prob; will be length ncells + 1, see cell_weights) for more details. defaults to NULL

Value

a list (if sequential) or a data.table (if kernel based) with the resulting x and y coordinates, cell ids, whether the movement was to a invalid cell, whether the movement fell within the bounds of the simulation, and the path id for the exposed.


mrajeev08/simrabid documentation built on May 7, 2021, 11:47 a.m.