From f55859d4957b94304b8fe4f71833cb5e769f6792 Mon Sep 17 00:00:00 2001 From: Sathvik Bhagavan Date: Sun, 7 Jan 2024 04:55:13 +0000 Subject: [PATCH] refactor: add points in DYCORS irrespective of best or not --- src/Optimization.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Optimization.jl b/src/Optimization.jl index cfc3e0ba..f42ba2d7 100755 --- a/src/Optimization.jl +++ b/src/Optimization.jl @@ -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]) @@ -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])