This function will execute a SLiM script generated by the compile function during the compilation of a slendr demographic model.

slim(
model,
sequence_length,
recombination_rate,
output = file.path(model$path, "output"), spatial = !is.null(model$world),
sampling = NULL,
max_attempts = 1,
save_locations = FALSE,
method = c("batch", "gui"),
verbose = TRUE,
burnin = 0,
seed = NULL,
slim_path = NULL,
save_sampling = FALSE
)

## Arguments

model Model object created by the compile function Total length of the simulated sequence (in base-pairs) Recombination rate of the simulated sequence (in recombinations per basepair per generation) A shared prefix path of output files that will be generated by the model (by default, all files will share a prefix "output" and will be placed in the model directory) Should the model be executed in spatial mode? By default, if a world map was specified during model definition, simulation will proceed in a spatial mode. A data frame of times at which a given number of individuals should be remembered in the tree-sequence (see sampling for a function that can generate the sampling schedule in the correct format). If missing, only individuals present at the end of the simulation will be recorded in the tree-sequence output file. How many attempts should be made to place an offspring near one of its parents? Serves to prevent infinite loops on the SLiM backend. Default value is 100. Save location of each individual throughout the simulation? How to run the script? ("gui" - open in SLiMgui, "batch" - run on the command-line) Write the SLiM output log to the console (default FALSE)? Length of the burnin (in model's time units, i.e. years) Random seed (if missing, SLiM's own seed will be used) Optional way to specify path to an appropriate SLiM binary Save the sampling schedule table together with other output files? If FALSE (default), the sampling table will be saved to a temporary directory.