Skip to content

Commit bb909c1

Browse files
committed
fix(check): corrections for devtools::check()
1 parent fba4fca commit bb909c1

3 files changed

Lines changed: 28 additions & 34 deletions

File tree

R/choose_replications.R

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -506,37 +506,35 @@ ReplicationsAlgorithm <- R6Class("ReplicationsAlgorithm", list( # nolint: object
506506
))
507507

508508

509-
#' Automated replications selection using Welfordbased online statistics.
509+
#' Automated replications selection using Welford-based online statistics.
510510
#'
511511
#' @description
512-
#' A userfriendly 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 halfwidth 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+
540538
run_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 plainlist 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

R/simulation-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#' @importFrom simmer get_mon_attributes get_mon_resources get_queue_count now
1919
#' @importFrom simmer release run seize set_attribute simmer timeout
2020
#' @importFrom simmer trajectory wrap
21-
#' @importFrom stats rexp sd setNames t.test
21+
#' @importFrom stats rexp sd setNames time t.test
2222
#' @importFrom tibble tibble
2323
#' @importFrom tidyr drop_na pivot_wider
2424
#' @importFrom tidyselect all_of any_of

man/run_replications_algorithm.Rd

Lines changed: 12 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)