Description Usage Arguments Details Value Examples
Run ca() over a parameter array.
1 2 |
model |
A valid object of class 'ca_model'. Defaults to musselbed. Valid
values are: |
init |
A valid numerical vector of initial cover. Length must be equal
to |
width |
An integer number. Defaults to 50 and is ignored if a landscape
object is provided in |
height |
An integer number. Defaults to |
parms |
A list of parameters with one or several parameters containing a
vector of parameter values. Those will be combined full-factorially using
|
save |
Logical. If TRUE, each individual run is saved to a file. They
can be loaded into the current working environment using
|
filename |
A character vector specifying the root of the filename of the saved files, including a relative path. It will be extended by an individual iteration ID and the fileending ".Rd". Note: If running in parallel on a cluster, output files will be saved in the workers home directory! |
salt |
An integer number. Used as seed when generating seeds for each single simulation run. Those generated seeds are returned in the output of the function. |
... |
parameters handed over to function |
The function is used to create gradients along one parameter value
or an array of parameter values. It runs the simulation for each parameter
value or combination of parameter values while making use of a parallel
backend provided by foreach
.
Make sure to adapt the type of parallel backend to your computer infrastructure (see package vignette of the foreach -package).
Returns a dataframe with global and local cover for each state for
each parameter value or combination of parameter values given in
parms
.
The function returns a dataframe with global and local cover for each state for each parameter value or combination of parameter values given in 'parms', as well as the seed used for the individual simulation run.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
p <- list(
r = 0.4, # recolonisation of empty sites dependent on local density
d = seq(0,1,0.1), # wave disturbance
delta = 0.01, # intrinsic disturbance rate
replicates = 1:2 # repeat the same parameter set twice
)
# provides parallel backend
library(foreach)
library(doMC)
registerDoMC(cores=7)
musselgradient <- ca_array(musselbed, parms = p, init = c(0.6,0.2,0.2), t_max = 400, save = TRUE, file = "out/musselbed")
registerDoSEQ()
musselgradient
plot(musselgradient[,"mean_cover.+"] ~ musselgradient$d, pch = 20)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.