使用mco包进行多目标优化

时间:2015-12-18 04:50:06

标签: r

我正在使用它提供的mco包。我有两个目标:

f1=x1(16+y^2)^1/2+x2(1+y^2)^1/2
f2=max(AC,BC)

如何使用nsga2对此进行编码?有人可以举例吗?

1 个答案:

答案 0 :(得分:0)

该文档提供了有关如何添加新功能以使用该包进行评估的示例。该文件是here。从文档中举例说明VNT问题

## VNT problem:
vnt <- function(x) {
y <- numeric(3)
xn <- crossprod(x, x)
y[1] <- xn/2 + sin(xn);
y[2] <- (crossprod(c(3, -2), x) + 4)^2/8 + (crossprod(c(1, -1), x) + 1)^2/27 + 15
y[3] <- 1/(xn + 1) - 1.1*exp(-xn)
return (y)
}

r2 <- nsga2(vnt, 2, 3,
generations=150, popsize=100,
lower.bounds=rep(-3, 2),
upper.bounds=rep(3, 2))

plot(r2)
相关问题