Skip to contents

Abstract base class for instances that evaluate an objective function. This class provides common functionality shared between optimization (OptimInstance) and other evaluation patterns (e.g., active learning).

Details

EvalInstance contains the core components needed for any objective evaluation loop:

  • An Objective to evaluate

  • A search space defining valid inputs

  • An Archive storing evaluation history

  • A Terminator defining stopping conditions

Subclasses add specific functionality:

  • OptimInstance: Result tracking, optimization-specific methods

  • External packages may define their own subclasses

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.

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

is_terminated

(logical(1))
Whether the terminator says we should stop.

n_evals

(integer(1))
Number of evaluations performed.

Methods


Method new()

Creates a new instance of this R6 class.

Usage

EvalInstance$new(
  objective,
  search_space,
  terminator,
  archive,
  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.

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

EvalInstance$format(...)

Arguments

...

(ignored).


Method print()

Printer.

Usage

EvalInstance$print(...)

Arguments

...

(ignored).


Method clear()

Clear all evaluation results from archive.

Usage

EvalInstance$clear()


Method clone()

The objects of this class are cloneable with this method.

Usage

EvalInstance$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.