draw_comm_next_gen: Draw a new community from the current one

View source: R/draw_comm_next_gen.R

draw_comm_next_genR Documentation

Draw a new community from the current one

Description

From the trait values of the current community, compute the fitness, draw offspring, apply mutations and resolve speciation events.

Usage

draw_comm_next_gen(
  island_comm,
  mainland_comm,
  growth_rate = comrad::default_growth_rate(),
  competition_sd = comrad::default_competition_sd(),
  trait_opt = comrad::default_trait_opt(),
  carrying_cap_opt = comrad::default_carrying_cap_opt(),
  carrying_cap_sd = comrad::default_carrying_cap_sd(),
  mutation_sd = comrad::default_mutation_sd(),
  trait_dist_sp = comrad::default_trait_dist_sp(),
  brute_force_opt = "none",
  used_species_names
)

Arguments

island_comm

a tibble with one row per individual in the community and three columns:

  • z contains (numeric) traits values

  • species contains species names (characters)

  • ancestral_species contains ancestral species names (characters)

  • founder (characters), the mainland species that this species' clade originates from.

mainland_comm

a tibble defining what species exist in the mainland and their trait distribution. One row per species, three columns:

  • species, (character) the name of the species

  • mean_z, (numeric) mean value of the trait for that species

  • z_sd, (numeric) standard deviation of the trait for that species

growth_rate

numeric >= 0, the baseline growth rate. Generations being discrete, high values will cause chaos.

competition_sd

numeric >= 0.Parameter σ_{α} of the competition coefficient. Modulates the the strength of competition between two individuals given their distance in trait space.

trait_opt

numeric. The optimal trait value, z_{opt}. get_carrying_cap(trait_opt) = carrying_cap_opt.

carrying_cap_opt

numeric, value of the carrying capacity at trait_opt

carrying_cap_sd

numeric >= 0. Parameter σ_K of the carrying capacity. Modulates how fast the carrying capacity decays when moving away from the optimal trait value.

mutation_sd

numeric >= 0, the standard deviation of the normal distrbution from which mutations are drawn.

trait_dist_sp

numeric, the minimal trait distance between two clusters of individuals triggering speciation.

brute_force_opt

a string specifying which brute force option to use to speed up the calculation of competition coefficients. Defaults to "none". Other options are "omp", for multithreading with OpenMP, "simd" for single instruction, multiple data (SIMD) via the C++ library xsimd; and "simd_omp" for both.

Author(s)

Théo Pannetier


TheoPannetier/comsie documentation built on Nov. 21, 2022, 4:35 p.m.