% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MCIS_helpers.R
\name{resolve_future_seed}
\alias{resolve_future_seed}
\title{Resolve and validate RNG seed for Future backend}
\usage{
resolve_future_seed(seed)
}
\arguments{
\item{seed}{Optional seed value provided by user or upstream function.}
}
\value{
A normalized object suitable for direct use in the argument
        \code{future.seed = resolve_future_seed(seed)} inside
        [future.apply::future_lapply()].
}
\description{
Internal helper to normalize the \code{seed} argument used in
\link[future.apply]{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 \link[parallel]{nextRNGStream}),
or \code{NULL}/\code{TRUE} for fully random behavior.

This avoids common errors such as:
\itemize{
  \item "Argument 'seed' must be L'Ecuyer-CMRG RNG seed ..." when passing incomplete streams,
  \item identical random numbers on all workers due to improper seeding,
  \item non-reproducible results across different backends.
}

May be one of:
\itemize{
  \item A single numeric/integer value (e.g. 1234) - fixed reproducible run.
  \item A numeric vector of length 7 (L'Ecuyer-CMRG stream) - substreams per worker.
  \item NULL - automatically use fully random streams (\code{future.seed = TRUE}).
 }
}
\seealso{
[TesiproV::MC_IS()], [parallel::nextRNGStream()], [future.apply::future_lapply()]
}
\author{
(C) 2026 M. Ricker - TU Dortmund University - Chair of Structural Concrete
}
\keyword{internal}
