Parallel evaluation and reproducible reporting

gsDesignTune uses {future} (via {future.apply}) for parallel evaluation. You control parallelism using future::plan(); gsDesignTune does not set a global plan.

library(gsDesign)
library(gsDesignTune)
library(future)

Parallel run (example)

plan(multisession, workers = 2)

job <- gsSurvTune(
  k = 3,
  test.type = 4,
  alpha = 0.025,
  beta = 0.10,
  timing = tune_values(list(c(0.33, 0.67, 1), c(0.5, 0.75, 1))),
  hr = tune_seq(0.60, 0.75, length_out = 5),
  upper = SpendingFamily$new(
    SpendingSpec$new(sfLDOF, par = tune_fixed(0)),
    SpendingSpec$new(sfHSD, par = tune_seq(-4, 4, length_out = 5))
  ),
  lower = SpendingSpec$new(sfLDOF, par = tune_fixed(0)),
  lambdaC = log(2) / 6,
  eta = 0.01,
  gamma = c(2.5, 5, 7.5, 10),
  R = c(2, 2, 2, 6),
  T = 18,
  minfup = 6,
  ratio = 1
)

job$run(strategy = "grid", parallel = TRUE, seed = 1, cache_dir = "gstune_cache")

Export a report

report_path <- tempfile(fileext = ".html")
job$report(report_path)
report_path
#> [1] "/var/folders/f2/bgpmhwqs3k9g88gtrfxjf4rh0000gn/T//RtmpFH758y/file247030659c60.html"