Skip to content

Commit

Permalink
refactor: add key to result
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Jul 19, 2024
1 parent fbcfc6d commit b9521e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/Optimizer.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ Optimizer = R6Class("Optimizer",
assign_result_default = function(inst) {
assert_r6(inst, "OptimInstance")
res = inst$archive$best()
xdt = res[, inst$search_space$ids(), with = FALSE]
ids = inst$search_space$ids()
if ("keys" %in% names(res)) ids = c(ids, "keys")
xdt = res[, ids, with = FALSE]

if (inherits(inst, "OptimInstanceBatchMultiCrit") || inherits(inst, "OptimInstanceAsyncMultiCrit")) {
ydt = res[, inst$archive$cols_y, with = FALSE]
Expand Down

0 comments on commit b9521e9

Please sign in to comment.