View source: R/mc_is_helpers.R
| resolve_future_seed | R Documentation |
Internal helper to normalize the seed argument used in
future_lapply calls within Monte Carlo simulations.
The function ensures that the supplied seed is of a valid type:
either a single integer (for deterministic runs),
a complete L'Ecuyer-CMRG RNG stream (as returned by nextRNGStream),
or NULL/TRUE for fully random behavior.
This avoids common errors such as:
"Argument 'seed' must be L'Ecuyer-CMRG RNG seed ..." when passing incomplete streams,
identical random numbers on all workers due to improper seeding,
non-reproducible results across different backends.
May be one of:
A single numeric/integer value (e.g. 1234) - fixed reproducible run.
A numeric vector of length 7 (L'Ecuyer-CMRG stream) - substreams per worker.
NULL - automatically use fully random streams (future.seed = TRUE).
resolve_future_seed(seed)
seed |
Optional seed value provided by user or upstream function. |
A normalized object suitable for direct use in the argument
future.seed = resolve_future_seed(seed) inside
[future.apply::future_lapply()].
(C) 2026 M. Ricker - TU Dortmund University - Chair of Structural Concrete
[TesiproV::MC_IS()], [parallel::nextRNGStream()], [future.apply::future_lapply()]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.