# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Simulate biomass and effort trajectories
#'
#' @useDynLib paradox
#' @param t_end Number of time steps to simulate over
#' @param num_pop Number of populations
#' @param alpha alpha parameter in the Shepherd stock-recruit
#' function (density-independent growth). Entered as a numeric vector
#' with one alpha per population.
#' @param beta beta parameter in the Shepherd stock-recruit function
#' (capacity parameter)
#' @param m Natural mortality
#' @param n n parameter in the Shepherd stock-recruit
#' function. Controls compensation level.
#' @param sigma Standard deviation on the simulated alpha values
#' @param q Effectiveness parameter in the effort function
#' @param cpar Operational costs parameter in the effort function
#' @param p Intrinsic value of the fishery parameter in the effort function
#' @param effort_init Initial effort.
#' @param biomas_init Initial population biomass. Recycled across
#' all populations.
#' @param vuln_threshold The vulnerability threshold. A proportion (between 0
#' and 1) indicating the fraction of the mean biomass of a subpopulation before
#' that subpopulation is declared "vulnerable".
#' @param burnin The number of years to discard as burnin.
#' @param return_ts Logical indicating whether the time series should be
#' returned as part of the output. \code{FALSE} by default to save memory if
#' running many repetitions.
#' @param print_diagnostics Logical indicating whether some print
#' statements should be enabled to help debug.
#' @author Original model developed by Justin Yeakel. C++ version
#' originally ported by Sean Anderson.
#' @return A list object. \code{$performance} contains the performance
#' attributes. If \code{return_ts = TRUE}: \code{$biomass} contains the biomass
#' matrix (time is incremented along the columns and populations down the rows;
#' the burnin period has been removed); \code{$effort} contains the effort in a
#' numeric vector with burnin removed.
#'
#' The \code{performance} data.frame contains (in order of columns)
#' the average-CV portfolio effect, the mean standard deviation of
#' the subpopulation biomasses, the mean mean of the subpopulation
#' biomasses, the standard deviation of the total biomass, the mean of
#' the total biomass, and the Loreau and de Mazancourt synchrony index.
#' @examples
#' out <- paradox_sim(alpha = rep(0.5, 10), return_ts = TRUE)
#' names(out)
#' print(out$performance)
#' op <- par(mfrow = c(2, 1), mar = c(4, 4, .5, .5))
#' matplot(t(out$biomass[, -c(1:500)]), type = "l", lty = 1, xlab = "Year",
#' ylab = "Biomass")
#' plot(out$effort[-c(1:500)], type = "l", ylab = "Effort", xlab = "Year")
#' par(op)
#' @export
paradox_sim <- function(t_end = 1000L, num_pop = 10L, alpha = numeric(), beta = 1/150, m = 0.01, n = 1, sigma = 0.05, q = 0.01, cpar = 1.4, p = 0.5, effort_init = 10, biomass_init = 50, vuln_thresh = 0.1, burnin = 500L, return_ts = FALSE, print_diagnostics = FALSE) {
.Call('paradox_paradox_sim', PACKAGE = 'paradox', t_end, num_pop, alpha, beta, m, n, sigma, q, cpar, p, effort_init, biomass_init, vuln_thresh, burnin, return_ts, print_diagnostics)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.