Skip to content

Commit

Permalink
refactor: add points in DYCORS irrespective of best or not
Browse files Browse the repository at this point in the history
  • Loading branch information
sathvikbhagavan committed Jan 7, 2024
1 parent b66096e commit f55859d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,8 @@ function surrogate_optimize(obj::Function, ::DYCORS, lb::Number, ub::Number,
if f_new < y_best
x_best = x_new
y_best = f_new
add_point!(surr1, x_best, y_best)
end
add_point!(surr1, x_new, f_new)
end
index = argmin(surr1.y)
return (surr1.x[index], surr1.y[index])
Expand Down Expand Up @@ -1189,8 +1189,8 @@ function surrogate_optimize(obj::Function, ::DYCORS, lb, ub, surrn::AbstractSurr
if f_new < y_best
x_best = x_new
y_best = f_new
add_point!(surrn, Tuple(x_best), y_best)
end
add_point!(surrn, Tuple(x_new), f_new)
end
index = argmin(surrn.y)
return (surrn.x[index], surrn.y[index])
Expand Down

0 comments on commit f55859d

Please sign in to comment.