Skip to content

An R package for multi/many-objective optimization with non-dominated genetic algorithms' family

License

Notifications You must be signed in to change notification settings

liusongplay/rmoo

 
 

Repository files navigation

rmoo - R Multi-Objective Optimization

R build status CRAN status Codecov test coverage Travis build status Lifecycle: maturing

Overview

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.

Installation

You can install the stable version on R CRAN:

install.packages("rmoo")

Or you can install the development version from GitHub:

# install.packages("devtools")
devtools::install_github("benitezfj/rmoo")

Usage

A simple example of running nsga3 solving the DTLZ1 problem:

library(rmoo)

DTLZ1 <- function (x, nobj = 3) 
{
    if (is.null(dim(x))) {
        x <- matrix(x, 1)
    }
    n <- ncol(x)
    y <- matrix(x[, 1:(nobj - 1)], nrow(x))
    z <- matrix(x[, nobj:n], nrow(x))
    g <- 100 * (n - nobj + 1 + rowSums((z - 0.5)^2 - cos(20 * 
        pi * (z - 0.5))))
    tmp <- t(apply(y, 1, cumprod))
    tmp <- cbind(t(apply(tmp, 1, rev)), 1)
    tmp2 <- cbind(1, t(apply(1 - y, 1, rev)))
    f <- tmp * tmp2 * 0.5 * (1 + g)
    return(f)
}

result <- nsga3(fitness = DTLZ1,
                type = "real-valued",
                lower = c(0,0,0),
                upper = c(1,1,1),
                popSize = 92,
                n_partitions = 12,
                maxiter = 300)

About

An R package for multi/many-objective optimization with non-dominated genetic algorithms' family

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 100.0%