Reputation: 31
I am using mco
package provided by it. I have two objectives:
f1=x1(16+y^2)^1/2+x2(1+y^2)^1/2
f2=max(AC,BC)
How do I code this using nsga2
? Could anyone provide examples?
Upvotes: 2
Views: 1583
Reputation: 1972
The documentation provides examples on how to add a new function to evaluate using the package. The document is given here. Taking an example from the document, for VNT
problem
## 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)
Upvotes: 1