Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

conversion

Conversion between minimization and maximization problems.


Description

We can minimize f by maximizing -f. The majority of predefined objective functions in smoof should be minimized by default. However, there is a handful of functions, e.g., Keane or Alpine02, which shall be maximized by default. For benchmarking studies it might be beneficial to inverse the direction. The functions convertToMaximization and convertToMinimization do exactly that keeping the attributes.

Usage

convertToMaximization(fn)

convertToMinimization(fn)

Arguments

fn

[smoof_function]
Smoof function.

Value

[smoof_function]

Note

Both functions will quit with an error if multi-objective functions are passed.

Examples

# create a function which should be minimized by default
fn = makeSphereFunction(1L)
print(shouldBeMinimized(fn))
# Now invert the objective direction ...
fn2 = convertToMaximization(fn)
# and invert it again
fn3 = convertToMinimization(fn2)
# Now to convince ourselves we render some plots
opar = par(mfrow = c(1, 3))
plot(fn)
plot(fn2)
plot(fn3)
par(opar)

smoof

Single and Multi-Objective Optimization Test Functions

v1.6.0.2
BSD_2_clause + file LICENSE
Authors
Jakob Bossek [aut, cre], Pascal Kerschke [ctb]
Initial release
2020-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.