Define a new soo_function object.

Share:

Description

Define a new soo_function object.

Usage

1
2
  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-z0-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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.