CollinErickson / comparer
Showing 1 of 1 files from the diff.

@@ -354,12 +354,25 @@
Loading
354 354
    #' @param nugget.estim Should a nugget be estimated?
355 355
    #' @param ... Passed into `ffexp$run_all`.
356 356
    run_EI_for_time = function(sec, batch_size, covtype="matern5_2",
357 -
                               nugget.estim=TRUE, ...) {
358 -
      start_time <- proc.time()
359 -
      while(proc.time()[3] - start_time[3] < sec) {
357 +
                               nugget.estim=TRUE, verbose=0, ...) {
358 +
      pb <- progress::progress_bar$new(
359 +
        format=paste0("  Running for time (:spin) [:bar] :elapsed / ", sec, "s"),
360 +
        total=sec)
361 +
      pb$tick(0)
362 +
      start_time <- Sys.time() #proc.time()
363 +
      ncompleted <- 0
364 +
      minbefore <- min(self$Z)
365 +
      # while(proc.time()[3] - start_time[3] < sec) {
366 +
      while(as.numeric(Sys.time() - start_time, units='secs') < sec) {
360 367
        self$add_EI(n=batch_size, covtype=covtype, nugget.estim=nugget.estim)
361 -
        self$run_all(...)
368 +
        self$run_all(verbose=0, ...)
369 +
        ncompleted <- ncompleted + 1
370 +
        pb$update(ratio=min(1, as.numeric(Sys.time() - start_time, units='secs') / sec))
362 371
      }
372 +
      pb$terminate()
373 +
      message(paste0("Completed ", ncompleted, " new points in ",
374 +
                     round(as.numeric(Sys.time() - start_time, units='secs'), 1), " seconds\n",
375 +
                     "Reduced minimum from ", signif(minbefore,5), " to ", signif(min(self$Z),5)))
363 376
      invisible(self)
364 377
    },
365 378
    #' @description Make a plot to summarize the experiment.
Files Coverage
R 69.73%
Project Totals (4 files) 69.73%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading