simulate,Metapopulation-method {Ease}R Documentation

Simulate method for the Metapopulation class

Description

Performing simulations of an Metapopulation object. The returned object is the same Metapopulation object completed with the results and records if they have been activated.

Usage

## S4 method for signature 'Metapopulation'
simulate(
  object,
  nsim = 1,
  seed = NULL,
  threshold = 500,
  includefreqGeno = TRUE,
  recording = FALSE,
  recordGenGap = 1,
  drift = TRUE,
  includeParams = TRUE,
  includeFitness = TRUE,
  verbose = FALSE,
  stopCondition = list(),
  nameOutFunct = "outFunct"
)

Arguments

object

a Metapopulation object

nsim

the number of simulation to perform

seed

the RNG seed to be fixed (allows exact reproduction of results)

threshold

maximum duration of a simulation (in generations)

includefreqGeno

a logical indicating whether to include genotype frequencies in the results

recording

a logical indicating whether to record all mutations, i.e. to record allelic and genotypic frequencies along the simulations

recordGenGap

the number of generations between two records during simulation, if the record parameter is TRUE. Whatever the value of this parameter, both the first and the last generation will be included in the record

drift

a logical indicating whether genetic drift should be considered (i.e. whether deterministic simulations are performed or not)

includeParams

a logical indicating whether the parameters should be included in the result data.frame (can be useful when compiling multiple result tables)

includeFitness

a logical indicating whether the mean fitness should be included in the result data.frame (can be useful when compiling multiple result tables)

verbose

logical determining if the progress of the simulations should be displayed or not (useful in case of many simulations)

stopCondition

list of vectors that each describe the allele(s) that must be fixed to define a stop condition. Each of these vectors will therefore be associated with a stop condition

nameOutFunct

name of the custom output function. This function is called each generation in each population of a simulation and systematically returns a list with the first element being a logic that indicates whether something should be saved. If so, the second element of this list will be saved.If the customOutFunct parameter is null (default), there will be no custom output.

Value

An Metapopulation object from which we can now extract the results (or the records if recording = TRUE) with the getResults and getRecords functions.

Author(s)

Ehouarn Le Faou


[Package Ease version 0.1.2 Index]