R/RcppExports.R

Defines functions simulatorCpp disperse

Documented in disperse simulatorCpp

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @title Disperse
#' 
#' @description
#' C++ code for dispersal
#' 
#' @name disperse
#' 
#' @param a IntegerVector. Final dispesal positions
#' @param Rdispersal int. Dispersal radius in cells
#' @param grid int. Number of cell per side of the matrix
#' 
#' @examples
#' disperse(c(10, 10), 2, 20)
#' 
#' @export
disperse <- function(a, Rdispersal, grid) {
    .Call(`_ecoevosimulator_disperse`, a, Rdispersal, grid)
}

#' @title simulator C++
#' 
#' @description
#' Eco-evolutionary simulator in C++.
#' 
#' @name simulatorCpp
#' 
#' @param Topo matrix. Topography matrix generated with `sinusoidalTopogrpahy`, 
#'                     `squareDiamondTopography`, `paracouTopography`.
#' @param NCI matrix. NCI matrix generated with `generateNCI`.
#' @param grid int. Number of cell per side of the matrix.
#' @param Nt int. Number of time steps.
#' @param timestep int. Time-step length in years.
#' @param sigmaGtopo double. Variance of genetic values with topography.
#' @param sigmaZtopo double. Plasticity of phenotypes with topography.
#' @param sigmaGnci double. Variance of genetic values with NCI.
#' @param sigmaZnci double. Plasticity of phenotypes with NCI.
#' @param Pdeath double. Background mortality probability.
#' @param Ns int. Number of seedlings per cell.
#' @param Rpollination int. Pollination radius in cells (father to mother).
#' @param Rdispersion int. Dispersal radius in cells (mother to seedling).
#' @param determinist bool. Deterministic or probabilistic viability.
#' 
#' @return List of 6 Topography, Atopo, Ztopo, NCI, Anci, Znci.
#' 
#' @examples
#' simulatorCpp(Topo = sinusoidalTopography(grid = 10, Elim = 5, amplitude = 0.01), 
#'              NCI = generateNCI(grid = 10, Nt = 50))
#' 
#' @export
simulatorCpp <- function(Topo, NCI, grid = 10L, Nt = 50L, timestep = 30L, sigmaGtopo = 1, sigmaZtopo = 1, sigmaGnci = 2.651, sigmaZnci = 2.651, Pdeath = 0.01325548, Ns = 4L, Rpollination = 1L, Rdispersion = 1L, determinist = TRUE) {
    .Call(`_ecoevosimulator_simulatorCpp`, Topo, NCI, grid, Nt, timestep, sigmaGtopo, sigmaZtopo, sigmaGnci, sigmaZnci, Pdeath, Ns, Rpollination, Rdispersion, determinist)
}
sylvainschmitt/ecoevosimulator documentation built on Nov. 19, 2020, 8:04 a.m.