A Non-Dominated Sorting based Multi-Objective Optimization package, built upon the ‘GA’ package.
‘rmoo’ provides a complete and flexible framework for optimizing multiple supplied objectives. You will have at your disposal a wide range of configuration options for the NSGA, NSGA-II and NSGA-III algorithms, as well as representation of real numbers, permutations and binaries.
You can install the stable version on R CRAN:
install.packages("rmoo")
Or you can install the development version from GitHub:
# install.packages("devtools")
::install_github("Evolutionary-Optimization-Laboratory/rmoo") devtools
A simple example of running nsga3 solving the DTLZ1 problem:
library(rmoo)
<- function (x, nobj = 3)
DTLZ1
{if (is.null(dim(x))) {
<- matrix(x, 1)
x
}<- ncol(x)
n <- matrix(x[, 1:(nobj - 1)], nrow(x))
y <- matrix(x[, nobj:n], nrow(x))
z <- 100 * (n - nobj + 1 + rowSums((z - 0.5)^2 - cos(20 *
g * (z - 0.5))))
pi <- t(apply(y, 1, cumprod))
tmp <- cbind(t(apply(tmp, 1, rev)), 1)
tmp <- cbind(1, t(apply(1 - y, 1, rev)))
tmp2 <- tmp * tmp2 * 0.5 * (1 + g)
f return(f)
}
<- nsga3(fitness = DTLZ1,
result type = "real-valued",
lower = c(0,0,0),
upper = c(1,1,1),
popSize = 92,
n_partitions = 12,
maxiter = 300)
pcp(object = result)
#Scatter without optimal points
scatter(object = result)
#Scatter with optimal points (Using reference points as optimal points)
scatter(object = result, optimal = result@reference_points)
#Polar Coordinates
polar(fitness = result@fitness[1:3,])
#Heatmap Plot
heat_map(fitness = result@fitness[1:3,])