Skip to contents

The OptimInstance specifies an optimization problem for an Optimizer.

Details

OptimInstance is an abstract base class that implements the base functionality each instance must provide. 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)
Objective function of the instance.

search_space

(paradox::ParamSet)
Specification of the search space for the Optimizer.

terminator

Terminator
Termination criterion of the optimization.

archive

(Archive)
Contains all performed function calls of the Objective.

progressor

(progressor())
Stores progressor function.

Active bindings

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

result

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

result_x_search_space

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

is_terminated

(logical(1)).

Methods


Method new()

Creates a new instance of this R6 class.

Usage

OptimInstance$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 format()

Helper for print outputs.

Usage

OptimInstance$format(...)

Arguments

...

(ignored).


Method print()

Printer.

Usage

OptimInstance$print(...)

Arguments

...

(ignored).


Method assign_result()

The Optimizer object writes the best found point and estimated performance value here. For internal use.

Usage

OptimInstance$assign_result(xdt, y, ...)

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.

...

(any)
ignored.


Method clear()

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

Usage

OptimInstance$clear()


Method clone()

The objects of this class are cloneable with this method.

Usage

OptimInstance$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.