validate_optimizer: Validate 'optimizer' object

View source: R/legacy.R

validate_optimizerR Documentation

Validate optimizer object

Description

This function validates an optimizer object.

Usage

validate_optimizer(
  x = new_optimizer(),
  .validate = FALSE,
  .validation_settings = list()
)

Arguments

x

An object of class optimizer.

.validate

A logical, set to TRUE (FALSE) to (not) validate the optimizer object. By default, .validate = FALSE.

.validation_settings

Ignored if .valdiate = FALSE. Otherwise, a list of validation settings:

objective_test

A function, the test function to be optimized. By default, it is the Ackley function.

objective_add

A list of additional arguments to objective_test (if any). By default, objective_add = list(), because the default function for objective_test does not have additional arguments.

initial

A numeric vector, the initial values for the optimization of objective_test. By default, initial = round(stats::rnorm(2), 2).

check_seconds

An integer, the maximum number of seconds before the test is aborted. The test call is considered to be successful if no error occurred within check_seconds seconds. By default, check_seconds = 10.

Value

The validated input x.


optimizeR documentation built on April 4, 2025, 1:56 a.m.