Skip to content

Commit 3135f10

Browse files
committed
Fix solution u in CMAEvolutionStrategy
1 parent 302d6f1 commit 3135f10

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ function SciMLBase.__solve(cache::OptimizationCache{
7676
local x, cur, state
7777

7878
function _cb(opt, y, fvals, perm)
79-
curr_u = opt.logger.xbest[end]
79+
curr_u = xbest(opt)
8080
opt_state = Optimization.OptimizationState(; iter = length(opt.logger.fmedian),
8181
u = curr_u,
8282
p = cache.p,
83-
objective = opt.logger.fbest[end],
83+
objective = fbest(opt),
8484
original = opt.logger)
8585

8686
cb_call = cache.callback(opt_state, x...)
@@ -112,8 +112,8 @@ function SciMLBase.__solve(cache::OptimizationCache{
112112
time = t1 - t0,
113113
fevals = length(opt_res.logger.fmedian))
114114
SciMLBase.build_solution(cache, cache.opt,
115-
opt_res.logger.xbest[end],
116-
opt_res.logger.fbest[end]; original = opt_res,
115+
xbest(opt_res),
116+
fbest(opt_res); original = opt_res,
117117
retcode = opt_ret,
118118
stats = stats)
119119
end

0 commit comments

Comments
 (0)