genNDSet: Generate a sample of nondominated points. In gMOIP: Tools for 2D and 3D Plots of Single and Multi-Objective Linear/Integer Programming Models

Description

Generate a sample of nondominated points.

Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12``` ```genNDSet( p, n, range = c(1, 100), random = FALSE, sphere = TRUE, box = FALSE, keep = FALSE, crit = "min", dubND = TRUE, ... ) ```

Arguments

 `p` Dimension of the points. `n` Number of samples generated (note only a subset of these will be non-dominated). `range` The range of the points in each dimension (a vector or matrix with `p` rows). `random` Random sampling. `sphere` Generate points on a sphere. `box` Generate points in boxes. `keep` Keep dominated points also. `crit` Criteria used (a vector of min/max). `dubND` Should duplicated non-dominated points be considered as non-dominated. `...` Further arguments passed on to `genSample`.

Value

A data frame with `p+1` columns (last one indicate if dominated or not).

Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35``` ```range <- matrix(c(1,100, 50,100, 10,50), ncol = 2, byrow = TRUE ) pts <- genNDSet(3, 50, range = range, random = TRUE, keep = TRUE) head(pts) Rfast::colMinsMaxs(as.matrix(pts)) ini3D(FALSE, argsPlot3d = list(xlim = c(min(pts[,1])-2,max(pts[,1])+10), ylim = c(min(pts[,2])-2,max(pts[,2])+10), zlim = c(min(pts[,3])-2,max(pts[,3])+10))) plotPoints3D(pts[,1:3]) plotPoints3D(pts[pts\$nd,1:3], argsPlot3d = list(col = "red", size = 10)) plotCones3D(pts[pts\$nd,1:3], argsPolygon3d = list(alpha = 1)) finalize3D() ini3D() range <- c(1,100) cent <- rep(range[1] + (range[2]-range[1])/2, 3) pts <- genNDSet(3, 100, range = range, sphere = TRUE, keep = TRUE, argsSphere = list(center = cent)) rgl::spheres3d(cent, radius=49.5, color = "grey100", alpha=0.1) plotPoints3D(pts) plotPoints3D(pts[pts\$nd,], argsPlot3d = list(col = "red", size = 10)) rgl::planes3d(cent[1],cent[2],cent[3],-sum(cent^2), alpha = 0.5, col = "red") finalize3D() ini3D() cent <- c(100,100,100) r <- 75 planeC <- c(cent+r/3) planeC <- c(planeC, -sum(planeC^2)) pts <- genNDSet(3, 100, keep = TRUE, argsSphere = list(center = cent, radius = r, below = FALSE, plane = planeC, factor = 6)) rgl::spheres3d(cent, radius=r, color = "grey100", alpha=0.1) plotPoints3D(pts) plotPoints3D(pts[pts\$nd,], argsPlot3d = list(col = "red", size = 10)) rgl::planes3d(planeC[1],planeC[2],planeC[3],planeC[4], alpha = 0.5, col = "red") finalize3D() ```

gMOIP documentation built on Aug. 23, 2021, 5:09 p.m.