Skip to content

Commit

Permalink
Added check, fixed print out for run EI for time
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinErickson committed Jun 10, 2021
1 parent 73fd248 commit 32eff14
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/hype.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,18 @@ hype <- R6::R6Class(
self$paruppertrans <- c(self$paruppertrans, pari$fromraw(pari$upper))
self$partrans <- c(self$partrans, pari$partrans)
}
stopifnot(length(self$parnames) == c(length(self$parlowerraw),
length(self$parupperraw),
length(self$parlowertrans),
length(self$paruppertrans),
length(self$partrans)))
self$parlist <- parlist
if (!is.null(X0)) {
stop("X0 not working yet, need to check with raw/trans")
}
X0trans <- NULL
if (!missing(n_lhs)) {
# Use add_LHS here?
Xlhstrans <- lhs::maximinLHS(n=n_lhs, k=length(self$parnames))
Xlhstrans <- sweep(sweep(Xlhstrans,
2, self$paruppertrans - self$parlowertrans, "*"
Expand Down Expand Up @@ -366,7 +372,7 @@ hype <- R6::R6Class(
while(as.numeric(Sys.time() - start_time, units='secs') < sec) {
self$add_EI(n=batch_size, covtype=covtype, nugget.estim=nugget.estim)
self$run_all(verbose=0, ...)
ncompleted <- ncompleted + 1
ncompleted <- ncompleted + batch_size
pb$update(ratio=min(1, as.numeric(Sys.time() - start_time, units='secs') / sec))
}
pb$terminate()
Expand Down

0 comments on commit 32eff14

Please sign in to comment.