walker {stppSim} | R Documentation |
A landscape walker
Description
A dynamic object capable of moving and avoiding obstacles on a landscape.
Usage
walker(n = 5, s_threshold = 250, step_length = 20,
poly = NULL, restriction_feat=NULL, field = NA, coords=c(0,0),
pt_itx = TRUE, show.plot = FALSE)
Arguments
n |
number of events to be generated by a walker within a temporal bin. |
s_threshold |
defines the spatial
perception range of a walker at a given
location. Default: |
step_length |
the maximum step taken by a walker from one point to the next. |
poly |
(An sf or S4 object) a polygon shapefile defining the extent of the landscape |
restriction_feat |
(An S4 object) optional
shapefile containing features
in which walkers cannot walk through.
Default: |
field |
a number in the range of |
coords |
a vector of the form c(x, y) giving the
initial coordinates of a walker (i.e., coordinates
of origins).
Default value is |
pt_itx |
To check whether any of the
specified initial origin coordinates
falls outside the boundary.
Default: |
show.plot |
(TRUE or False) To show the time series
plot. Default is |
Details
A walker is propelled by an in-built stochastic
transition matrix
and a specified set of spatial and temporal
parameters. The transition
matrix defines two states, namely; the exploratory
and a performative
states. A walker is capable
of avoiding obstructions (i.e., restriction_feat
)
if included. The resulting number of events may be
slightly different from the value n
because of the
stochastic process involved.
Value
Returns a trace of walker's path, and the resulting events.
References
Quaglietta L, Porto M (2019). SiMRiv: Individual-Based, Spatially-Explicit Simulation and Analysis of Multi-State Movements in River Networks and Heterogeneous Landscapes_. R package version 1.0.4, <URL: https://CRAN.R-project.org/package=SiMRiv>.
Examples
#load boundary of Camden
load(file = system.file("extdata", "camden.rda",
package="stppSim"))
boundary = camden$boundary # get boundary
walkerpath <- walker(n = 5, s_threshold = 250, step_length = 20,
poly = boundary, restriction_feat=NULL, field = NULL,
coords = c(0,0), pt_itx = TRUE, show.plot = FALSE)
#plot(walkerpath)