diff --git a/DESCRIPTION b/DESCRIPTION index 79395bcc..78e21923 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -53,7 +53,7 @@ Encoding: UTF-8 Language: en-US NeedsCompilation: no Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Collate: 'Archive.R' 'ArchiveAsync.R' diff --git a/R/OptimInstanceAsyncMultiCrit.R b/R/OptimInstanceAsyncMultiCrit.R index a96d0796..eb49302d 100644 --- a/R/OptimInstanceAsyncMultiCrit.R +++ b/R/OptimInstanceAsyncMultiCrit.R @@ -50,8 +50,10 @@ OptimInstanceAsyncMultiCrit = R6Class("OptimInstanceAsyncMultiCrit", #' For internal use. #' #' @param ydt (`numeric(1)`)\cr - #' Optimal outcomes, e.g. the Pareto front. - assign_result = function(xdt, ydt) { + #' Optimal outcomes, e.g. the Pareto front. + #' @param ... (`any`)\cr + #' ignored. + assign_result = function(xdt, ydt, ...) { # FIXME: We could have one way that just lets us put a 1xn DT as result directly. assert_data_table(xdt) assert_names(names(xdt), must.include = self$search_space$ids()) diff --git a/R/OptimInstanceAsyncSingleCrit.R b/R/OptimInstanceAsyncSingleCrit.R index fffdb8b5..e32ebcab 100644 --- a/R/OptimInstanceAsyncSingleCrit.R +++ b/R/OptimInstanceAsyncSingleCrit.R @@ -52,7 +52,9 @@ OptimInstanceAsyncSingleCrit = R6Class("OptimInstanceAsyncSingleCrit", #' #' @param y (`numeric(1)`)\cr #' Optimal outcome. - assign_result = function(xdt, y) { + #' @param ... (`any`)\cr + #' ignored. + assign_result = function(xdt, y, ...) { # FIXME: We could have one way that just lets us put a 1xn DT as result directly. assert_data_table(xdt) assert_names(names(xdt), must.include = self$search_space$ids()) diff --git a/R/OptimInstanceBatchMultiCrit.R b/R/OptimInstanceBatchMultiCrit.R index 8986adeb..22294651 100644 --- a/R/OptimInstanceBatchMultiCrit.R +++ b/R/OptimInstanceBatchMultiCrit.R @@ -44,7 +44,9 @@ OptimInstanceBatchMultiCrit = R6Class("OptimInstanceBatchMultiCrit", #' The [Optimizer] object writes the best found points #' and estimated performance values here (probably the Pareto set / front). #' For internal use. - assign_result = function(xdt, ydt) { + #' @param ... (`any`)\cr + #' ignored. + assign_result = function(xdt, ydt, ...) { # FIXME: We could have one way that just lets us put a 1xn DT as result directly. assert_data_table(xdt) assert_names(names(xdt), must.include = self$search_space$ids()) diff --git a/R/OptimInstanceBatchSingleCrit.R b/R/OptimInstanceBatchSingleCrit.R index 5e35a1c3..7a016882 100644 --- a/R/OptimInstanceBatchSingleCrit.R +++ b/R/OptimInstanceBatchSingleCrit.R @@ -50,7 +50,9 @@ OptimInstanceBatchSingleCrit = R6Class("OptimInstanceBatchSingleCrit", #' #' @param y (`numeric(1)`)\cr #' Optimal outcome. - assign_result = function(xdt, y) { + #' @param ... (`any`)\cr + #' ignored. + assign_result = function(xdt, y, ...) { # FIXME: We could have one way that just lets us put a 1xn DT as result directly. assert_data_table(xdt) assert_names(names(xdt), must.include = self$search_space$ids()) diff --git a/R/Optimizer.R b/R/Optimizer.R index 8f08e072..b81db536 100644 --- a/R/Optimizer.R +++ b/R/Optimizer.R @@ -165,9 +165,11 @@ Optimizer = R6Class("Optimizer", #' @export assign_result_default = function(inst) { assert_r6(inst, "OptimInstance") + res = inst$archive$best() ids = inst$search_space$ids() - if ("keys" %in% names(res)) ids = c(ids, "keys") + # workaround until ... works + if ("internal_tuned_values" %in% names(res)) ids = c(ids, "internal_tuned_values") xdt = res[, ids, with = FALSE] if (inherits(inst, "OptimInstanceBatchMultiCrit") || inherits(inst, "OptimInstanceAsyncMultiCrit")) { diff --git a/man/OptimInstanceAsyncMultiCrit.Rd b/man/OptimInstanceAsyncMultiCrit.Rd index 4f9cbcb2..3730834f 100644 --- a/man/OptimInstanceAsyncMultiCrit.Rd +++ b/man/OptimInstanceAsyncMultiCrit.Rd @@ -92,7 +92,7 @@ If a rush instance is supplied, the tuning runs without batches.} The \link{OptimizerAsync} writes the best found points and estimated performance values here (probably the Pareto set / front). For internal use. \subsection{Usage}{ -\if{html}{\out{
}}\preformatted{OptimInstanceAsyncMultiCrit$assign_result(xdt, ydt)}\if{html}{\out{
}} +\if{html}{\out{
}}\preformatted{OptimInstanceAsyncMultiCrit$assign_result(xdt, ydt, ...)}\if{html}{\out{
}} } \subsection{Arguments}{ @@ -106,6 +106,9 @@ However, \code{xdt} can contain additional columns.} \item{\code{ydt}}{(\code{numeric(1)})\cr Optimal outcomes, e.g. the Pareto front.} + +\item{\code{...}}{(\code{any})\cr +ignored.} } \if{html}{\out{}} } diff --git a/man/OptimInstanceAsyncSingleCrit.Rd b/man/OptimInstanceAsyncSingleCrit.Rd index 4a18e520..227761df 100644 --- a/man/OptimInstanceAsyncSingleCrit.Rd +++ b/man/OptimInstanceAsyncSingleCrit.Rd @@ -92,7 +92,7 @@ If a rush instance is supplied, the tuning runs without batches.} The \link{OptimizerAsync} object writes the best found point and estimated performance value here. For internal use. \subsection{Usage}{ -\if{html}{\out{
}}\preformatted{OptimInstanceAsyncSingleCrit$assign_result(xdt, y)}\if{html}{\out{
}} +\if{html}{\out{
}}\preformatted{OptimInstanceAsyncSingleCrit$assign_result(xdt, y, ...)}\if{html}{\out{
}} } \subsection{Arguments}{ @@ -106,6 +106,9 @@ However, \code{xdt} can contain additional columns.} \item{\code{y}}{(\code{numeric(1)})\cr Optimal outcome.} + +\item{\code{...}}{(\code{any})\cr +ignored.} } \if{html}{\out{}} } diff --git a/man/OptimInstanceBatchMultiCrit.Rd b/man/OptimInstanceBatchMultiCrit.Rd index e60d2767..9d58324c 100644 --- a/man/OptimInstanceBatchMultiCrit.Rd +++ b/man/OptimInstanceBatchMultiCrit.Rd @@ -91,7 +91,7 @@ The \link{Optimizer} object writes the best found points and estimated performance values here (probably the Pareto set / front). For internal use. \subsection{Usage}{ -\if{html}{\out{
}}\preformatted{OptimInstanceBatchMultiCrit$assign_result(xdt, ydt)}\if{html}{\out{
}} +\if{html}{\out{
}}\preformatted{OptimInstanceBatchMultiCrit$assign_result(xdt, ydt, ...)}\if{html}{\out{
}} } \subsection{Arguments}{ @@ -105,6 +105,9 @@ However, \code{xdt} can contain additional columns.} \item{\code{ydt}}{(\code{\link[data.table:data.table]{data.table::data.table()}})\cr Optimal outcome.} + +\item{\code{...}}{(\code{any})\cr +ignored.} } \if{html}{\out{}} } diff --git a/man/OptimInstanceBatchSingleCrit.Rd b/man/OptimInstanceBatchSingleCrit.Rd index 1d0dea26..0a27cc0f 100644 --- a/man/OptimInstanceBatchSingleCrit.Rd +++ b/man/OptimInstanceBatchSingleCrit.Rd @@ -79,7 +79,7 @@ List of callbacks.} The \link{Optimizer} object writes the best found point and estimated performance value here. For internal use. \subsection{Usage}{ -\if{html}{\out{
}}\preformatted{OptimInstanceBatchSingleCrit$assign_result(xdt, y)}\if{html}{\out{
}} +\if{html}{\out{
}}\preformatted{OptimInstanceBatchSingleCrit$assign_result(xdt, y, ...)}\if{html}{\out{
}} } \subsection{Arguments}{ @@ -93,6 +93,9 @@ However, \code{xdt} can contain additional columns.} \item{\code{y}}{(\code{numeric(1)})\cr Optimal outcome.} + +\item{\code{...}}{(\code{any})\cr +ignored.} } \if{html}{\out{}} }