#Two Objectives Plotting
zdt1 <- function (x) {
if (is.null(dim(x))) {
x <- matrix(x, nrow = 1)
}
n <- ncol(x)
g <- 1 + rowSums(x[, 2:n, drop = FALSE]) * 9/(n - 1)
return(cbind(x[, 1], g * (1 - sqrt(x[, 1]/g))))
}
#Not run
if (FALSE) {
result <- nsga3(type = "real-valued",
fitness = zdt1,
lower = c(0,0),
upper = c(1,1),
popSize = 100,
n_partitions = 100,
monitor = FALSE,
maxiter = 500)
}
#Not run
if (FALSE) {
scatter(object = result)
}
Run the code above in your browser using DataLab