Abstract base class.

## Technical details

The Optimizer writes the final result to the .result field by using the $assign_result() method. .result stores a data.table::data.table consisting of x values in the search space, (transformed) x values in the domain space and y values in the codomain space of the Objective. The user can access the results with active bindings (see below). ## Public fields objective (Objective). search_space terminator (Terminator). archive (Archive). progressor (progressor()) Stores progressor function. 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 ### Method new() Creates a new instance of this R6 class. #### Usage OptimInstance$new(
objective,
search_space = NULL,
terminator,
keep_evals = "all",
check_values = TRUE
)

#### Arguments

objective

(Objective).

search_space

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).

keep_evals

(character(1))
Keep all or only best evaluations in archive?

check_values

(logical(1))
Should x-values that are added to the archive be checked for validity? Search space that is logged into archive.

### Method format()

Helper for print outputs.

#### Arguments

...

(ignored).

### 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.

#### Arguments

xdt

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

y

(numeric(1))
Optimal outcome.

### Method objective_function()

#### Arguments

x

(numeric())
Untransformed points.

#### Returns

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

### Method clear()

Reset terminator and clear all evaluation results from archive and results.

#### Arguments

deep

Whether to make a deep clone.