Learn R Programming

soobench (version 1.9.18)

soo_function: Single Objective Optimization Function

Description

Define a new soo_function object.

Usage

soo_function(
  name,
  id,
  fun,
  dimensions,
  lower_bounds,
  upper_bounds,
  best_value,
  best_par
)

Arguments

name

Name of function.

id

Short id for the function. Must be unique to the function instance and should not contain any other characters than [a-z], [0-9] and ‘-’.

fun

Function definition.

dimensions

Size of parameter space.

lower_bounds

Lower bounds of the parameter space.

upper_bounds

Upper bounds of the parameter space.

best_value

Best known function value.

best_par

Parameter settings that correspond to best_value. If there are multiple global minima, this should be a list with one entry for each minimum.

Value

A soo_function object.

Examples

Run this code
# NOT RUN {
## Given the following simple benchmark function:
f_my_sphere <- function(x)
  sum((x-1)*(x-1))

## we can define a corresponding 2d soo_function:
f <- soo_function("My Sphere", "my-sphere-2d", f_my_sphere, 2,
                  c(-10, -10), c(10, 10),
                  0, c(1, 1))

## And then plot it:
plot(f)

# }

Run the code above in your browser using DataLab