restart_experiment: Restart experimental simulations.

View source: R/simulate.R

restart_experimentR Documentation

Restart experimental simulations.

Description

Note for most of this function's arguments, their default value is NULL, which results in them being the same as for the original simulations. The exceptions to this are the arguments sims_obj, new_starts, stage_ts_out, max_t, save_every, perturb, and no_warns. Arguments sims_obj, new_starts, and stage_ts_out are new to this function (see their documentation below for details). Arguments max_t and save_every are set to 250 and 1, respectively, which results in a shorter time series with greater resolution, the typical use case for this function. Argument perturb has a default value of NULL which results in no perturbations. You can input a new data frame if you want to perturb these restarted experiments. If the initial simulations had perturbations but the new one won't, this function will provide a warning indicating this. You can suppress this warning by setting no_warns = TRUE.

Usage

restart_experiment(
  sims_obj,
  new_starts = NULL,
  stage_ts_out = FALSE,
  max_t = 250,
  save_every = 1,
  alate_field_disp_p = NULL,
  K = NULL,
  alate_b0 = NULL,
  alate_b1 = NULL,
  K_y_mult = NULL,
  s_y = NULL,
  a = NULL,
  k = NULL,
  h = NULL,
  wasp_disp_m0 = NULL,
  wasp_disp_m1 = NULL,
  wasp_field_attract = NULL,
  mum_smooth = NULL,
  pred_rate = NULL,
  sep_adults = NULL,
  show_progress = NULL,
  perturb = NULL,
  no_warns = FALSE
)

Arguments

sims_obj

A cloneSims object output from sim_experiments.

new_starts

A dataframe or list of dataframes indicating the new starting abundances for all populations (wasps, mummies, all aphid lines) and stages. It should be the exact same format as what's in sims_obj$all_info. (But don't change sims_obj$all_info to make this be true!)

stage_ts_out

Single logical for whether to output stage-structured information for all time points. If TRUE, the output object will contain this information in the stage_ts field, which will be a list of data frames. Defaults to FALSE.

max_t

How many days to simulate. Defaults to 250.

save_every

Abundances will be stored every save_every time points. Defaults to 1.

alate_field_disp_p

Proportion of alates from each field that are added to the dispersal pool. After adding alates to the pool, they are then evenly distributed to all fields. This happens only on days indicated by plant_check_gaps. Defaults to 0.1.

K

Aphid density dependence. Defaults to 12.5e3 because this caused simulations to approximately match experiments.

alate_b0

The proportion of offspring from apterous aphids is inv_logit(alate_b0 + alate_b1 * N) where N is the total number of aphids on that plant. Defaults to -5.

alate_b1

The proportion of offspring from apterous aphids is inv_logit(alate_b0 + alate_b1 * N) where N is the total number of aphids on that plant. Defaults to 0.0022, which makes alate production only mildly density dependent.

K_y_mult

The number multiplied by K to get density dependence for parasitized aphids. Defaults to 1 / 1.57, which is from Meisner et al. (2014).

s_y

Daily survival rate of adult wasps. Defaults to populations$s_y, which is from Meisner et al. (2014).

a

Parasitoid attack rate. Defaults to the internal object wasp_attack$a, which is from Meisner et al. (2014).

k

Aggregation parameter of the negative binomial distribution. Defaults to the internal object wasp_attack$k, which is from Meisner et al. (2014).

h

Parasitoid handling time. Defaults to the internal object wasp_attack$h, which is from Meisner et al. (2014).

wasp_disp_m0

Proportion of adult wasps from each field that are added to the dispersal pool when there are no aphids present. After adding wasps to the pool, they are then evenly distributed to all fields. This happens only on days indicated by plant_check_gaps. Defaults to 0.

wasp_disp_m1

Effect of aphid density on wasp emigration from a patch. Emigration is wasp_disp_m0 * exp(-wasp_disp_m1 * log(z)), where z is the total number of living aphids in the patch. Defaults to 0.

wasp_field_attract

Relatively attractiveness of fields to wasps. This affects the proportion of wasps that immigrate from the dispersal pool to each field. It doesn't change the number of wasps that leave fields. This can be a single numeric or a numeric vector of length n_fields. If a single numeric is provided, all fields are equally attractive to wasps. If a vector is provided, then the vector is divided by its sum (to make it sum to 1), then those values are used as the proportion of wasps from the dispersal pool that immigrate to each field. Defaults to 1.

mum_smooth

Proportion of mummies that will NOT take exactly 3 days to develop. As this value approaches 2/3, it will provide greater smoothing of wasp numbers through time. Defaults to 0.4.

pred_rate

Daily predation rate on aphids and mummies. Defaults to 0.1 to compensate for losses from plants dying.

show_progress

Boolean for whether to show progress bar. Defaults to FALSE.

perturb

Information for perturbing populations in the simulations. It should be a dataframe with 4 columns: * when: Integers indicating at what timepoint(s) to do the perturbations. These can be repeated if you want to perturb multiple things at the same time. * where: What field to do the perturbations in. * who: Which population to perturb. This can be a character vector where values must be the name of an aphid line, "wasps", or "mummies". It can also be an integer vector where, for n aphid lines, values ⁠<= n⁠ indicate an aphid line, values ⁠== n+1⁠ indicate mummies, and values ⁠== n+2⁠ indicate adult wasps. Note that perturbing the mummy population also perturbs the still-living but parasitized aphids, too. * how: Numbers ⁠>= 0⁠ that are multiplied by the desired population to cause the perturbation.


lucasnell/clonewars documentation built on Oct. 12, 2023, 4:39 p.m.