Skip to contents

The OptimInstanceBatch specifies an optimization problem for an OptimizerBatch. The function oi() creates an OptimInstanceAsyncSingleCrit or OptimInstanceAsyncMultiCrit.

Super class

bbotk::OptimInstance -> OptimInstanceBatch

Public fields

objective_multiplicator

(integer()).

Active bindings

result

(data.table::data.table)
Get result

result_x_search_space

(data.table::data.table)
x part of the result in the search space.

result_x_domain

(list())
(transformed) x part of the result in the domain space of the objective.

result_y

(numeric())
Optimal outcome.

is_terminated

(logical(1)).

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

OptimInstanceBatch$new(
  objective,
  search_space = NULL,
  terminator,
  check_values = TRUE,
  callbacks = NULL,
  archive = NULL,
  label = NA_character_,
  man = NA_character_
)

Arguments

objective

(Objective)
Objective function.

search_space

(paradox::ParamSet)
Specifies the search space for the Optimizer. The paradox::ParamSet describes either a subset of the domain of the Objective or it describes a set of parameters together with a trafo function that transforms values from the search space to values of the domain. Depending on the context, this value defaults to the domain of the objective.

terminator

Terminator
Termination criterion.

check_values

(logical(1))
Should points before the evaluation and the results be checked for validity?

callbacks

(list of mlr3misc::Callback)
List of callbacks.

archive

(Archive).

label

(character(1))
Label for this object. Can be used in tables, plot and text output instead of the ID.

man

(character(1))
String in the format [pkg]::[topic] pointing to a manual page for this object. The referenced help package can be opened via method $help().


Method eval_batch()

Evaluates all input values in xdt by calling the Objective. Applies possible transformations to the input values and writes the results to the Archive.

Before each batch-evaluation, the Terminator is checked, and if it is positive, an exception of class terminated_error is raised. This function should be internally called by the Optimizer.

Usage

OptimInstanceBatch$eval_batch(xdt)

Arguments

xdt

(data.table::data.table())
x values as data.table() with one point per row. Contains the value in the search space of the OptimInstance object. Can contain additional columns for extra information.


Method objective_function()

Evaluates (untransformed) points of only numeric values. Returns a numeric scalar for single-crit or a numeric vector for multi-crit. The return value(s) are negated if the measure is maximized. Internally, $eval_batch() is called with a single row. This function serves as a objective function for optimizers of numeric spaces - which should always be minimized.

Usage

OptimInstanceBatch$objective_function(x)

Arguments

x

(numeric())
Untransformed points.

Returns

Objective value as numeric(1), negated for maximization problems.


Method clone()

The objects of this class are cloneable with this method.

Usage

OptimInstanceBatch$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.