Add discrete points to a non-dominated set and classify them into extreme supported, non-extreme supported, non-supported.
Source:R/ndset.R
addNDSet.Rd
Add discrete points to a non-dominated set and classify them into extreme supported, non-extreme supported, non-supported.
Arguments
- pts
A data frame with points to add (a column for each objective).
- nDSet
A data frame with current non-dominated set (NULL if none yet). Column names of the p objectives must be
z1, ..., zp
.- crit
A max or min vector. If length one assume all objectives are optimized in the same direction.
- keepDom
Keep dominated points in output.
- dubND
Duplicated non-dominated points are classified as non-dominated.
- classify
Non-dominated points are classified into supported extreme (
se
), supported non-extreme (sne
) and unsupported (us
).
Value
A data frame with a column for each objective (z
columns) and nd
(non-dominated).
Moreover if classify
then columns se
, sne
, us
and cls
.
Author
Lars Relund lars@relund.dk
Examples
nDSet <- data.frame(z1=c(12,14,16,18), z2=c(18,16,12,4))
pts <- data.frame(z1 = c(18,18,14,15,15), z2=c(2,6,14,14,16))
addNDSet(pts, nDSet, crit = "max")
#> z1 z2 nd se sne us cls
#> 1 12 18 TRUE TRUE FALSE FALSE se
#> 2 16 12 TRUE FALSE FALSE TRUE us
#> 3 18 6 TRUE TRUE FALSE FALSE se
#> 4 15 16 TRUE TRUE FALSE FALSE se
addNDSet(pts, nDSet, crit = "max", keepDom = TRUE)
#> z1 z2 nd se sne us cls
#> 1 12 18 TRUE TRUE FALSE FALSE se
#> 2 14 16 FALSE FALSE FALSE TRUE d
#> 3 16 12 TRUE FALSE FALSE TRUE us
#> 4 18 4 FALSE FALSE FALSE TRUE d
#> 5 18 2 FALSE FALSE FALSE TRUE d
#> 6 18 6 TRUE TRUE FALSE FALSE se
#> 7 14 14 FALSE FALSE FALSE TRUE d
#> 8 15 14 FALSE FALSE FALSE TRUE d
#> 9 15 16 TRUE TRUE FALSE FALSE se
addNDSet(pts, nDSet, crit = "min")
#> z1 z2 nd se sne us cls
#> 1 12 18 TRUE TRUE FALSE FALSE se
#> 2 16 12 TRUE FALSE FALSE TRUE us
#> 3 18 2 TRUE TRUE FALSE FALSE se
#> 4 14 14 TRUE FALSE FALSE TRUE us
addNDSet(c(2,2), nDSet, crit = "max")
#> z1 z2 nd se sne us cls
#> 1 12 18 TRUE TRUE FALSE FALSE se
#> 2 14 16 TRUE TRUE FALSE FALSE se
#> 3 16 12 TRUE TRUE FALSE FALSE se
#> 4 18 4 TRUE TRUE FALSE FALSE se
addNDSet(c(2,2), nDSet, crit = "min")
#> z1 z2 nd se sne us cls
#> 1 2 2 TRUE TRUE FALSE FALSE se
# \donttest{
nDSet <- data.frame(z1=c(12,14,16,18), z2=c(18,16,12,4), z3 = c(1,7,0,6))
pts <- data.frame(z1=c(12,14,16,18), z2=c(18,16,12,4), z3 = c(2,2,2,6))
crit = c("min", "min", "max")
di <- c(1,1,-1)
li <- c(-1,20)
ini3D(argsPlot3d = list(xlim = li, ylim = li, zlim = li))
plotCones3D(nDSet, direction = di, argsPolygon3d = list(color = "green", alpha = 1),
drawPoint = FALSE)
plotHull3D(nDSet, addRays = TRUE, direction = di)
plotPoints3D(nDSet, argsPlot3d = list(col = "red"), addText = "coord")
plotPoints3D(pts, addText = "coord")
finalize3D()
3D plot
addNDSet(pts, nDSet, crit, dubND = FALSE)
#> z1 z2 z3 nd se sne us cls
#> 1 14 16 7 TRUE TRUE FALSE FALSE se
#> 2 12 18 2 TRUE TRUE FALSE FALSE se
#> 3 16 12 2 TRUE FALSE FALSE TRUE us
#> 4 18 4 6 TRUE TRUE FALSE FALSE se
addNDSet(pts, nDSet, crit, dubND = TRUE)
#> z1 z2 z3 nd se sne us cls
#> 1 14 16 7 TRUE TRUE FALSE FALSE se
#> 2 18 4 6 TRUE TRUE FALSE FALSE se
#> 3 12 18 2 TRUE TRUE FALSE FALSE se
#> 4 16 12 2 TRUE FALSE FALSE TRUE us
#> 5 18 4 6 TRUE TRUE FALSE FALSE se
addNDSet(pts, nDSet, crit, dubND = TRUE, keepDom = TRUE)
#> z1 z2 z3 nd se sne us cls
#> 1 12 18 1 FALSE FALSE FALSE TRUE d
#> 2 14 16 7 TRUE TRUE FALSE FALSE se
#> 3 16 12 0 FALSE FALSE FALSE TRUE d
#> 4 18 4 6 TRUE TRUE FALSE FALSE se
#> 5 12 18 2 TRUE TRUE FALSE FALSE se
#> 6 14 16 2 FALSE FALSE FALSE TRUE d
#> 7 16 12 2 TRUE FALSE FALSE TRUE us
#> 8 18 4 6 TRUE TRUE FALSE FALSE se
addNDSet(pts, nDSet, crit, dubND = TRUE, keepDom = TRUE, classify = FALSE)
#> z1 z2 z3 nd
#> 1 12 18 1 FALSE
#> 2 14 16 7 TRUE
#> 3 16 12 0 FALSE
#> 4 18 4 6 TRUE
#> 5 12 18 2 TRUE
#> 6 14 16 2 FALSE
#> 7 16 12 2 TRUE
#> 8 18 4 6 TRUE
# }