Classify a set of nondominated points
Arguments
- pts
A set of non-dominated points. It is assumed that
ncol(pts)equals the number of objectives ($p$).- direction
Ray direction. If i'th entry is positive, consider the i'th column of the
ptsplus a value greater than on equal zero (minimize objective $i$). If negative, consider the i'th column of theptsminus a value greater than on equal zero (maximize objective $i$).
Value
The classification is extreme (se), supported non-extreme (sne) and unsupported us
nondominated points. Return the ND set with classification columns se (true/false), sne
(true/false), us (true/false) and cls (se, sne or us).
Examples
# \donttest{
pts <- matrix(c(0,0,1, 0,1,0, 1,0,0, 0.5,0.2,0.5, 0.25,0.5,0.25), ncol = 3, byrow = TRUE)
ini3D(argsPlot3d = list(xlim = c(min(pts[,1])-2,max(pts[,1])+2),
ylim = c(min(pts[,2])-2,max(pts[,2])+2),
zlim = c(min(pts[,3])-2,max(pts[,3])+2)))
plotHull3D(pts, addRays = TRUE, argsPolygon3d = list(alpha = 0.5), useRGLBBox = TRUE)
#> Warning: edge not found:1 2
#> Warning: edge not found:1 2
pts <- classifyNDSet(pts[,1:3])
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[pts$sne,1:3], argsPlot3d = list(col = "black"))
plotPoints3D(pts[pts$us,1:3], argsPlot3d = list(col = "blue"))
plotCones3D(pts[,1:3], rectangle = TRUE, argsPolygon3d = list(alpha = 1))
finalize3D()
3D plot
pts
#> z1 z2 z3 se sne us cls
#> 1 0.00 0.0 1.00 TRUE FALSE FALSE se
#> 2 0.00 1.0 0.00 TRUE FALSE FALSE se
#> 3 1.00 0.0 0.00 TRUE FALSE FALSE se
#> 4 0.50 0.2 0.50 FALSE FALSE TRUE us
#> 5 0.25 0.5 0.25 FALSE TRUE FALSE sne
pts <- matrix(c(0,0,1, 0,1,0, 1,0,0, 0.2,0.1,0.1, 0.1,0.45,0.45), ncol = 3, byrow = TRUE)
di <- -1 # maximize
ini3D(argsPlot3d = list(xlim = c(min(pts[,1])-1,max(pts[,1])+1),
ylim = c(min(pts[,2])-1,max(pts[,2])+1),
zlim = c(min(pts[,3])-1,max(pts[,3])+1)))
plotHull3D(pts, addRays = TRUE, argsPolygon3d = list(alpha = 0.5), direction = di,
addText = "coord")
#> Warning: edge not found:1 2
#> Warning: edge not found:1 2
pts <- classifyNDSet(pts[,1:3], direction = di)
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[pts$sne,1:3], argsPlot3d = list(col = "black"))
plotPoints3D(pts[pts$us,1:3], argsPlot3d = list(col = "blue"))
plotCones3D(pts[,1:3], rectangle = TRUE, argsPolygon3d = list(alpha = 1), direction = di)
finalize3D()
3D plot
pts
#> z1 z2 z3 se sne us cls
#> 1 0.0 0.00 1.00 TRUE FALSE FALSE se
#> 2 0.0 1.00 0.00 TRUE FALSE FALSE se
#> 3 1.0 0.00 0.00 TRUE FALSE FALSE se
#> 4 0.2 0.10 0.10 FALSE FALSE TRUE us
#> 5 0.1 0.45 0.45 FALSE TRUE FALSE sne
pts <- matrix(c(0,0,1, 0,0,1, 0,1,0, 0.5,0.2,0.5, 1,0,0, 0.5,0.2,0.5, 0.25,0.5,0.25), ncol = 3,
byrow = TRUE)
classifyNDSet(pts)
#> z1 z2 z3 se sne us cls
#> 1 0.00 0.0 1.00 TRUE FALSE FALSE se
#> 2 0.00 0.0 1.00 TRUE FALSE FALSE se
#> 3 0.00 1.0 0.00 TRUE FALSE FALSE se
#> 4 0.50 0.2 0.50 FALSE FALSE TRUE us
#> 5 1.00 0.0 0.00 TRUE FALSE FALSE se
#> 6 0.50 0.2 0.50 FALSE FALSE TRUE us
#> 7 0.25 0.5 0.25 FALSE TRUE FALSE sne
pts <- genNDSet(3,15)[,1:3]
ini3D(argsPlot3d = list(xlim = c(0,max(pts$z1)+2),
ylim = c(0,max(pts$z2)+2),
zlim = c(0,max(pts$z3)+2)))
plotHull3D(pts[, 1:3], addRays = TRUE, argsPolygon3d = list(alpha = 0.5))
#> Warning: edge not found:1 2
#> Warning: edge not found:1 2
pts <- classifyNDSet(pts[,1:3])
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[pts$sne,1:3], argsPlot3d = list(col = "black"))
plotPoints3D(pts[pts$us,1:3], argsPlot3d = list(col = "blue"))
finalize3D()
3D plot
pts
#> z1 z2 z3 se sne us cls
#> 1 1 48 54 TRUE FALSE FALSE se
#> 2 47 11 21 TRUE FALSE FALSE se
#> 3 19 23 24 TRUE FALSE FALSE se
#> 4 2 39 53 TRUE FALSE FALSE se
#> 5 8 75 42 FALSE FALSE TRUE us
#> 6 18 13 53 TRUE FALSE FALSE se
#> 7 44 18 14 TRUE FALSE FALSE se
#> 8 10 72 32 TRUE FALSE FALSE se
#> 9 26 62 9 TRUE FALSE FALSE se
#> 10 21 12 60 FALSE TRUE FALSE sne
#> 11 73 36 9 FALSE FALSE TRUE us
#> 12 21 13 38 TRUE FALSE FALSE se
#> 13 53 49 1 TRUE FALSE FALSE se
#> 14 48 3 38 TRUE FALSE FALSE se
#> 15 23 21 22 TRUE FALSE FALSE se
pts <- genNDSet(3, 15, keepDom = FALSE, argsSphere = list(below = FALSE, factor = 10))[,1:3]
ini3D(argsPlot3d = list(xlim = c(0,max(pts$z1)+2),
ylim = c(0,max(pts$z2)+2),
zlim = c(0,max(pts$z3)+2)))
plotHull3D(pts[, 1:3], addRays = TRUE, argsPolygon3d = list(alpha = 0.5))
#> Warning: edge not found:1 2
#> Warning: edge not found:1 2
pts <- classifyNDSet(pts[,1:3])
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[pts$sne,1:3], argsPlot3d = list(col = "black"))
plotPoints3D(pts[pts$us,1:3], argsPlot3d = list(col = "blue"))
finalize3D()
3D plot
pts
#> z1 z2 z3 se sne us cls
#> 1 88 55 18 TRUE FALSE FALSE se
#> 2 63 81 14 TRUE FALSE FALSE se
#> 3 29 95 47 TRUE FALSE FALSE se
#> 4 91 27 66 FALSE FALSE TRUE us
#> 5 86 64 19 FALSE FALSE TRUE us
#> 6 41 79 90 FALSE FALSE TRUE us
#> 7 23 49 92 TRUE FALSE FALSE se
#> 8 61 16 85 TRUE FALSE FALSE se
#> 9 35 91 74 FALSE FALSE TRUE us
#> 10 41 99 46 FALSE FALSE TRUE us
#> 11 95 36 36 TRUE FALSE FALSE se
#> 12 91 48 23 TRUE FALSE FALSE se
#> 13 88 33 79 FALSE FALSE TRUE us
#> 14 80 68 15 TRUE FALSE FALSE se
#> 15 58 27 93 FALSE FALSE TRUE us
# }