该算法本身无法识别某个点是否为非支配点.它返回的某些点占主导地位,并且仅包含点及其值,而不包含nsga2返回的逻辑向量. 我正在尝试获取非支配点(不是它们的值).使用nsga2的结果,您可以使用paretoSet()来获取值,但这取决于在nsga2期间是否已预先计算逻辑向量.我还查看了"mco"的paretoFront()/paretoFilter()和"emoa"包的nondominated_points()( pdf ),但是它们仅适用于值,无法获取积分.解决此问题的一种方法是接受值,然后对每个值遍历各个点,查看其是否具有该值,如果有,则将其添加到列表中.但是我认为必须存在一个返回点的函数.要重现此内容,您可以使用:res = nsga2(func, 3, 2, lower.bounds=rep(0, 5), upper.bounds=rep(1, 5))res$pareto.optimal = NULLpoints = paretoSet(res) # points will be empty because res does # not have the logic vector解决方案我自己找到了答案. (没有人回答超过2天似乎有点动机)为直观起见,此示例显示了实现非支配计算时如何保留点的颜色,显然,您也可以将其搜索空间坐标存储在多列中. (请注意:此示例专门针对2个目标,但可以概括)x = runif(20)y = runif(20)from = 1:20d = data.frame(x, y, from)dD = d[order(d$x, d$y), ]nondom = D[which(!duplicated(cummin(D$y))), ]nondomplot(d[,1:2], col=d$from, xlim=c(0,1), ylim=c(0,1))plot(nondom[,1:2], col=nondom$from, xlim=c(0,1), ylim=c(0,1))I wrote an algorithm that returns a list similar to that which nsga2 returns.(nsga2 of package "mco" (pdf))The algorithm can not itself recognize if a point is non-dominated. Some of the points it returns are dominated and it only contains the points and their values, not the logic-vector that nsga2 returns.I am trying to get the non-dominated points (not their values).With nsga2's result you can use paretoSet() to get the values, however that depends on that the logic-vector has been precomputed during nsga2.I also looked at paretoFront()/paretoFilter() of "mco" and nondominated_points() of package "emoa" (pdf), however they only work with the values, there is no way to get the points.One way to solve this would be to accept the values, and then for every value go through the points, look if it has that value and if so add it to a list. But I think there has to exist a function that returns the points.To reproduce this you could use:res = nsga2(func, 3, 2, lower.bounds=rep(0, 5), upper.bounds=rep(1, 5))res$pareto.optimal = NULLpoints = paretoSet(res) # points will be empty because res does # not have the logic vector 解决方案 Found the answer myself. (No one answering for more than 2 days seems somewhat of a motivation)For visualization this example shows how you would retain the color of points when you implement non-dominated-calculation, obviously you can also store their search-space coordinates in multiple columns instead. (note: this example is specialized on 2 objectives but that can be generalized)x = runif(20)y = runif(20)from = 1:20d = data.frame(x, y, from)dD = d[order(d$x, d$y), ]nondom = D[which(!duplicated(cummin(D$y))), ]nondomplot(d[,1:2], col=d$from, xlim=c(0,1), ylim=c(0,1))plot(nondom[,1:2], col=nondom$from, xlim=c(0,1), ylim=c(0,1)) 这篇关于帕累托优化-非支配点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-04 07:55