@@ -506,37 +506,35 @@ ReplicationsAlgorithm <- R6Class("ReplicationsAlgorithm", list( # nolint: object
506506))
507507
508508
509- # ' Automated replications selection using Welford‑ based online statistics.
509+ # ' Automated replications selection using Welford- based online statistics.
510510# '
511511# ' @description
512- # ' A user‑ friendly wrapper around the ReplicationsAlgorithm class that:
513- # ' - Runs the replications sequence
514- # ' - Returns minimum required replications for each metric
515- # ' - Returns summary tables for each metric (replication‑by‑ replication)
512+ # ' A user- friendly wrapper around the ReplicationsAlgorithm class that: (1)
513+ # ' Runs the replications sequence, (2) Returns minimum required replications
514+ # ' for each metric, and (3) Returns summary tables for each metric
515+ # ' (replication-by- replication).
516516# '
517517# ' Based on Hoad, Robinson, & Davies (2010) "Automated selection of the number
518518# ' of replications for a discrete-event simulation".
519+ # '
519520# ' You just call this as a function, without exposing the R6 internals.
520521# '
521522# ' @param param List, model configuration (passed to your `runner` or `model`).
522523# ' @param metrics Character vector of metric names (columns in `run_results`).
523- # ' @param desired_precision Target deviation of CI half‑ width as proportion
524- # ' of the mean, e.g. `0.1` for 10% .
524+ # ' @param desired_precision Target deviation of CI half- width as proportion
525+ # ' of the mean, e.g. `0.1` for 10 percent .
525526# ' @param initial_replications Number of initial replications.
526527# ' @param look_ahead Minimum extra replications to “look ahead”.
527528# ' @param replication_budget Maximum allowed replications.
528529# ' @param verbose Logical; whether to print startup messages.
529530# '
530- # ' @return A list with:
531- # ' \itemize{
532- # ' \item `nreps` named list of min replications per metric (or `NA` if not
533- # ' met).
534- # ' \item `summary_table` dataframe with per‑replication statistics for all
535- # ' metrics.
536- # ' \item `status` character vector: metrics for which desired precision was
537- # ' not reached.
538- # ' }
531+ # ' @return A list with: (1) `nreps` named list of min replications per metric
532+ # ' (or `NA` if not met), (2) `summary_table` dataframe with per-replication
533+ # ' statistics for all metrics, and (3) `status` character vector: metrics for
534+ # ' which desired precision was not reached.
535+ # '
539536# ' @export
537+
540538run_replications_algorithm <- function (
541539 param ,
542540 metrics = c(" mean_waiting_time_nurse" ,
@@ -562,7 +560,7 @@ run_replications_algorithm <- function(
562560 # Run the algorithm
563561 alg $ select()
564562
565- # Extract results in a plain‑ list form
563+ # Extract results in a plain- list form
566564 nreps <- as.list(alg $ nreps ) # numeric/NA for each metric
567565
568566 # Identify which metrics didn’t converge
0 commit comments