addGGOptima: Add (Known) Local Optima of Smoof Functions to Gradient Field...

Description Usage Arguments Value Examples

View source: R/addGGOptima.R

Description

If the underlying single-objective functions are smoof-functions, extract their local optima and add them to the gradient field heatmap.

Usage

1
2
addGGOptima(g, fn1, fn2, fn3, symbol1 = 21L, symbol2 = 22L,
  symbol3 = 24L, ...)

Arguments

g

[ggplot]
ggplot-object as created by ggplotHeatmap.

fn1

[function]
The first objective used for computing the multi-objective gradient.

fn2

[function]
The second objective used for computing the multi-objective gradient.

fn3

[function]
The third objective (if existing) used for computing the multi-objective gradient.

symbol1

[integer(1L) | character(1L)]
Symbol used for indicating the local optima of the first objective (default: 21L, i.e., a filled circle).

symbol2

[integer(1L) | character(1L)]
Symbol used for indicating the local optima of the second objective (default: 22L, i.e., a filled square).

symbol3

[integer(1L) | character(1L)]
Symbol used for indicating the local optima of the third objective (default: 24L, i.e., a filled triangle).

...

[any]
Further arguments to be passed to the geom_tile function of ggplot.

Value

[ggplot]
A ggplot object displaying the multi-objective gradient landscape.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Define two single-objective test problems and a grid of points:
fn1 = smoof::makeBBOBFunction(dimension = 2L, fid = 1L, iid = 1L)
fn2 = smoof::makeBBOBFunction(dimension = 2L, fid = 1L, iid = 2L)
points = as.matrix(expand.grid(x1 = seq(0, 1, 0.05), x2 = seq(0, 1, 0.05)))

## Not run: 
# Compute the corresponding gradients and the cumulated path lengths:
gradients = computeGradientField(points, fn1, fn2)
x = computeCumulatedPathLengths(points, gradients)

# Visualize the resulting multi-objective "landscape":
g = ggplotHeatmap(x)
g

# Add "pink" symbols to the optima of the respective objectives:
addGGOptima(g, fn1, fn2, size = 6, fill = "hotpink")

## End(Not run)

kerschke/mogsa documentation built on Oct. 27, 2018, 12:13 a.m.