Movatterモバイル変換


[0]ホーム

URL:


Title:Multi-Objective Optimization in R
Version:0.2.0
Description:The 'rmoo' package is a framework for multi- and many-objective optimization, which allows researchers and users versatility in parameter configuration, as well as tools for analysis, replication and visualization of results. The 'rmoo' package was built as a fork of the 'GA' package by Luca Scrucca(2017) <doi:10.32614/RJ-2017-008> and implementing the Non-Dominated Sorting Genetic Algorithms proposed by K. Deb's.
License:GPL-2 |GPL-3 [expanded from: GPL (≥ 2)]
Encoding:UTF-8
Language:es
LazyData:true
RoxygenNote:7.2.1
Collate:'AllClasses.R' 'associate.R' 'crowding_distance.R' 'data.R''generate_reference_points.R' 'geneticoperator.R''get_fixed_rowsum_integer_matrix.R' 'miscfun.R' 'AllGenerics.R''niching.R' 'non_dominated_fronts.R' 'nsga.R' 'nsga2.R''nsga3.R' 'nsgaControl.R' 'performance_metrics.R''reference_point_multi_layer.R' 'rmoo.R' 'rmoo_func.R''sharing.R' 'update_points.R' 'zzz.R'
Imports:stats, utils, graphics, methods, GA, grDevices, ggplot2,plotly
URL:https://github.com/Evolutionary-Optimization-Laboratory/rmoo/
BugReports:https://github.com/Evolutionary-Optimization-Laboratory/rmoo/issues/
Suggests:testthat, covr, rgl, ecr, emoa, cdata, dplyr, reshape2
Depends:R (≥ 2.10)
NeedsCompilation:no
Packaged:2022-09-24 01:14:40 UTC; Maria
Author:Francisco Benitez [aut, cre], Diego Pinto RoaORCID iD [aut]
Maintainer:Francisco Benitez <benitezfj94@gmail.com>
Repository:CRAN
Date/Publication:2022-09-24 02:20:02 UTC

rmoo: Multi-Objective Optimization in R

Description

logo

The 'rmoo' package is a framework for multi- and many-objective optimization, which allows researchers and users versatility in parameter configuration, as well as tools for analysis, replication and visualization of results. The 'rmoo' package was built as a fork of the 'GA' package by Luca Scrucca(2017)doi:10.32614/RJ-2017-008 and implementing the Non-Dominated Sorting Genetic Algorithms proposed by K. Deb's.

Author(s)

Maintainer: Francisco Benitezbenitezfj94@gmail.com

Authors:

See Also

Useful links:


Virtual Parent Class Algorithm

Description

It will use when other algorithms are implemented. Equivalent to a Abstractclass in other languages.


Association Operation in Non-Dominated Genetic Algorithms III

Description

Function that associates each member of the population with a reference point. The function calculates the perpendicular distance of each individual from each of the reference lines. This code section corresponds to Algorithm 3 of the referenced paper.

Usage

  associate_to_niches(object, utopian_epsilon = 0)  compute_perpendicular_distance(x, y)  compute_niche_count(n_niches, niche_of_individuals)

Arguments

object

An object of class"nsga3".

utopian_epsilon

The epsilon used for decrease the ideal point to get the utopian point.

x

Individuals to calculate their niche.

y

Reference points.

n_niches

Number of reference points.

niche_of_individuals

The niche count of individuals, except the last front.

Value

Returns a list with the niche count of individuals and the distances between them.

Author(s)

Francisco Benitez

References

J. Blank and K. Deb, "Pymoo: Multi-Objective Optimization in Python," in IEEE Access, vol. 8, pp. 89497-89509, 2020, doi: 10.1109/ACCESS.2020.2990567.

K. Deb and H. Jain, "An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I: Solving Problems With Box Constraints," in IEEE Transactions on Evolutionary Computation, vol. 18, no. 4, pp. 577-601, Aug. 2014, doi: 10.1109/TEVC.2013.2281535.


Calculation of Crowding Distance

Description

A Crowded-comparison approach.

Usage

crowding_distance(object, nObj)

Arguments

object,nObj

An object of class 'nsga2', usually resulting from a callto function nsga2. Fitness Function Objective Numbers

Details

The crowded-comparison operator guides the selection process at the variousstages of the algorithm toward a uniformly spread-out Pareto-optimal front

Value

A vector with the crowding-distance between individuals of a population.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

K. Deb, A. Pratap, S. Agarwal and T. Meyarivan, 'A fast andelitist multiobjective genetic algorithm: NSGA-II,' in IEEE Transactions onEvolutionary Computation, vol. 6, no. 2, pp. 182-197, April 2002,doi: 10.1109/4235.996017.

See Also

non_dominated_fronts()


Determination of Reference Points on a Hyper-Plane

Description

A implementation of Das and Dennis's Reference Points Generation.

Usage

generate_reference_points(m, h, scaling = NULL)

Arguments

m,h,scaling

Number of reference points 'h' in M-objective problems, andscaling that is the scale on which the points are distributed.

Details

The implemented Reference Point Generation is based on the Das and Dennis'ssystematic approach that places points on a normalized hyper-plane which isequally inclined to all objective axes and has an intercept of one on each axis.

Value

A matrix with the reference points uniformly distributed.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

K. Deb and H. Jain, 'An Evolutionary Many-Objective OptimizationAlgorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I:Solving Problems With Box Constraints,' in IEEE Transactions on EvolutionaryComputation, vol. 18, no. 4, pp. 577-601, Aug. 2014,doi: 10.1109/TEVC.2013.2281535.

Das, Indraneel & Dennis, J. (2000). Normal-Boundary Intersection: A NewMethod for Generating the Pareto Surface in Nonlinear MulticriteriaOptimization Problems. SIAM Journal on Optimization. 8.10.1137/S1052623496307510.

See Also

non_dominated_fronts() andget_fixed_rowsum_integer_matrix()


Accessor methods to the crowding distance for NSGA-II results

Description

Accessor methods to the crowding distance for NSGA-II results

Usage

getCrowdingDistance(obj)## S4 method for signature 'nsga2'getCrowdingDistance(obj)

Arguments

obj

an object resulting from the execution of NSGA-II algorithm

Value

Returns a vector with the crowding distances of class nsga2. Seensga2for a description of available slots information.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

Examples

# Where 'out' is an object resulting from the execution of the NSGA-II algorithm.## getCrowdingDistance(out)#

Accessor methods to the dummy fitness for NSGA-I results

Description

Accessor methods to the dummy fitness for NSGA-I results

Usage

getDummyFitness(obj)## S4 method for signature 'nsga1'getDummyFitness(obj)

Arguments

obj

an object resulting from the execution of NSGA-I algorithm

Value

Returns a matrix with the dummy fitness of class nsga1. Seensga1for a description of available slots information.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

Examples

# Where 'out' is an object resulting from the execution of the NSGA-I algorithm.## getDummyFitness(out)#

Accessor methods to the fitness for rmoo results

Description

Accessor methods to the fitness for rmoo results

Usage

getFitness(obj)

Arguments

obj

an object resulting from the execution of NSGA-I, NSGA-II or NSGA-IIIalgorithm

Value

Prints the resulting fitness and when the result of the method-callis assigned to a variable, the fitness is stored as a data frame.Seensga1nsga2,nsga3 for a description of availableslots information.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

Examples

# Where 'out' is an object resulting from the execution of the rmoo.## fitness_result <- getFitness(out)## fitness_result

Accessor methods to the metrics evaluated during execution

Description

Accessor methods to the metrics evaluated during execution

Usage

getMetrics(obj)## S4 method for signature 'nsga'getMetrics(obj)

Arguments

obj

an object resulting from the execution of NSGA-I, NSGA-II or NSGA-IIIalgorithm. During the execution of the performance metrics must be evaluated.

Value

A dataframe with performance metrics evaluated iteration by iteration.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

Examples

# Where 'out' is an object resulting from the execution of the rmoo.## metrics_result <- getMetrics(out)## metrics_result

Accessor methods to the population for rmoo results

Description

Accessor methods to the population for rmoo results

Usage

getPopulation(obj)## S4 method for signature 'nsga'getPopulation(obj)## S4 method for signature 'nsga'getFitness(obj)

Arguments

obj

an object resulting from the execution of NSGA-I, NSGA-II or NSGA-IIIalgorithm

Value

Prints the resulting population and when the result of the method-callis assigned to a variable, the population is stored as a data frame.Seensga1nsga2,nsga3 for a description of availableslots information.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

Examples

# Where 'out' is an object resulting from the execution of rmoo.## population_result <- getPopulation(out)## population_result

Determine the division points on the hyperplane

Description

Implementation of the recursive function in Generation of Reference points ofDas and Dennis..

Usage

get_fixed_rowsum_integer_matrix(m, h)

Arguments

m,h

Number of reference points 'h' in M-objective problems

Details

The implemented Reference Point Generation is based on the Das and Dennis'ssystematic approach that places points on a normalized hyper-plane which isequally inclined to all objective axes and has an intercept of one on eachaxis.

Value

A matrix with the reference points uniformly distributed.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

K. Deb and H. Jain, 'An Evolutionary Many-Objective OptimizationAlgorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I:Solving Problems With Box Constraints,' in IEEE Transactions on EvolutionaryComputation, vol. 18, no. 4, pp. 577-601, Aug. 2014,doi: 10.1109/TEVC.2013.2281535.

Das, Indraneel & Dennis, J.. (2000). Normal-Boundary Intersection: A NewMethod for Generating the Pareto Surface in Nonlinear MulticriteriaOptimization Problems. SIAM Journal on Optimization. 8.10.1137/S1052623496307510.

See Also

non_dominated_fronts() andgenerate_reference_points()


KROA100

Description

A dataset containing the coord and section of 100 cities

Usage

kroA100

Format

A data frame with 100 rows and 2 variables:

COORD

City Coordinates

SECTION

City Section

References

Reinelt, G. (1991). TSPLIB—A traveling salesman problem library.ORSA journal on computing, 3(4), 376-384


KROB100

Description

A dataset containing the coord and section of 100 cities

Usage

kroB100

Format

A data frame with 100 rows and 2 variables:

COORD

City Coordinates

SECTION

City Section

References

Reinelt, G. (1991). TSPLIB—A traveling salesman problem library.ORSA journal on computing, 3(4), 376-384


KROC100

Description

A dataset containing the coord and section of 100 cities

Usage

kroC100

Format

A data frame with 100 rows and 2 variables:

COORD

City Coordinates

SECTION

City Section

References

Reinelt, G. (1991). TSPLIB—A traveling salesman problem library.ORSA journal on computing, 3(4), 376-384


Niche-Preservation Operation

Description

Generation of niche, by associating reference points to population members

Usage

niching(pop, n_remaining, niche_count, niche_of_individuals, dist_to_niche)

Arguments

pop

Last Front Population

n_remaining

Number of points to choose

niche_count

Niche count of individuals with the reference point

niche_of_individuals

Count of the closest reference point to the lastfront objective values

dist_to_niche

Distance between closest reference point to last frontobjective values

Details

Niching procesure is a algorithms proposed by K. Deb and H. Jain in 2013.

Value

Returns the association of reference points to each individual in the population.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

K. Deb and H. Jain, 'An Evolutionary Many-Objective OptimizationAlgorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I:Solving Problems With Box Constraints,' in IEEE Transactions on EvolutionaryComputation, vol. 18, no. 4, pp. 577-601, Aug. 2014,doi: 10.1109/TEVC.2013.2281535.

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation,parallelisation and islands evolution. The R Journal, 9/1, 187-206.doi: 10.32614/RJ-2017-008

Felix-Antoine Fortin, Francois-Michel De Rainville, Marc-André GardnerGardner, Marc Parizeau, and Christian Gagne. 2012. DEAP: evolutionaryalgorithms made easy. J. Mach. Learn. Res. 13, 1 (January 2012), 2171–2175.

See Also

associate_to_niches(),PerformScalarizing()


Calculate of Non-Dominated Front

Description

A fast approach for calculate Non-Dominated Fronts.

Usage

non_dominated_fronts(object)

Arguments

object

An object of class 'nsga', usually resulting from a call tofunction nsga, nsga2 and nsga3.

Details

Function to determine the non-dominated fronts of a population and theaptitude value.

Value

A list with 'non-dominated fronts' and 'occupied positions' on the fronts.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

K. Deb, A. Pratap, S. Agarwal and T. Meyarivan, 'A fast andelitist multiobjective genetic algorithm: NSGA-II,' in IEEE Transactions onEvolutionary Computation, vol. 6, no. 2, pp. 182-197, April 2002,doi: 10.1109/4235.996017.

See Also

nsga(),nsga2() andnsga3()


Non-Dominated Sorting in Genetic Algorithms

Description

Minimization of a fitness function using Non-Dominated Genetic algorithms(NSGA). Local search using general-purpose optimisation algorithms can beapplied stochastically to exploit interesting regions.

Usage

nsga(  type = c("binary", "real-valued", "permutation"),  fitness,  ...,  lower,  upper,  nBits,  population = nsgaControl(type)$population,  selection = nsgaControl(type)$selection,  crossover = nsgaControl(type)$crossover,  mutation = nsgaControl(type)$mutation,  popSize = 50,  nObj = ncol(fitness(matrix(10000, ncol = 100, nrow = 100))),  dshare,  pcrossover = 0.8,  pmutation = 0.1,  maxiter = 100,  run = maxiter,  maxFitness = Inf,  names = NULL,  suggestions = NULL,  monitor = if (interactive()) nsgaMonitor else FALSE,  summary = FALSE,  seed = NULL)

Arguments

type

the type of genetic algorithm to be run depending on the natureof decision variables. Possible values are:

"binary"

for binary representations of decision variables.

"real-valued"

for optimization problems where the decisionvariables are floating-point representations of real numbers.

"permutation"

for problems that involves reordering of a listof objects.

fitness

the fitness function, any allowable R function which takes asinput an individual string representing a potential solution, and returns anumerical value describing its “fitness”.

...

additional arguments to be passed to the fitness function. Thisallows to write fitness functions that keep some variables fixed during thesearch.

lower

a vector of length equal to the decision variables providing thelower bounds of the search space in case of real-valued or permutationencoded optimizations.

upper

a vector of length equal to the decision variables providing theupper bounds of the search space in case of real-valued or permutationencoded optimizations.

nBits

a value specifying the number of bits to be used in binaryencoded optimizations.

population

an R function for randomly generating an initial population.Seensga_Population() for available functions.

selection

an R function performing selection, i.e. a function whichgenerates a new population of individuals from the current populationprobabilistically according to individual fitness.Seensga_Selection() for available functions.

crossover

an R function performing crossover, i.e. a function whichforms offsprings by combining part of the genetic information fromtheir parents. Seensga_Crossover() for available functions.

mutation

an R function performing mutation, i.e. a function whichrandomly alters the values of some genes in a parent chromosome.Seensga_Mutation() for available functions.

popSize

the population size.

nObj

number of objective in the fitness function.

dshare

the maximun phenotypic distance allowed between any twoindividuals to become members of a niche.

pcrossover

the probability of crossover between pairs of chromosomes.Typically this is a large value and by default is set to 0.8.

pmutation

the probability of mutation in a parent chromosome. Usuallymutation occurs with a small probability, and by default is set to 0.1.

maxiter

the maximum number of iterations to run before the NSGA searchis halted.

run

the number of consecutive generations without any improvement inthe best fitness value before the NSGA is stopped.

maxFitness

the upper bound on the fitness function after that the NSGAsearch is interrupted.

names

a vector of character strings providing the names of decisionvariables.

suggestions

a matrix of solutions strings to be included in theinitial population. If provided the number of columns must match the numberof decision variables.

monitor

a logical or an R function which takes as input the currentstate of the nsga-class object and show the evolution of the search. Bydefault, for interactive sessions the function nsgaMonitor prints the averageand best fitness values at each iteration. If set to plot these informationare plotted on a graphical device. Other functions can be written by the userand supplied as argument. In non interactive sessions, by defaultmonitor = FALSE so any output is suppressed.

summary

If there will be a summary generation after generation.

seed

an integer value containing the random number generator state.This argument can be used to replicate the results of a NSGA search. Notethat if parallel computing is required, the doRNG package must be installed.

Details

The Non-dominated genetic algorithms is a meta-heuristic proposed byN. Srinivas and K. Deb in 1994. The purpose of the algorithms is to find anefficient way to optimize multi-objectives functions (two or more).

Value

Returns an object of class nsga1-class. Seensga1 for adescription of available slots information.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

N. Srinivas and K. Deb, "Multiobjective Optimization UsingNondominated Sorting in Genetic Algorithms, in Evolutionary Computation,vol. 2, no. 3, pp. 221-248, Sept. 1994, doi: 10.1162/evco.1994.2.3.221.

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation,parallelisation and islands evolution. The R Journal, 9/1, 187-206.doi: 10.32614/RJ-2017-008

See Also

nsga2(),nsga3()

Examples

#Example#Two Objectives - Real Valuedzdt1 <- 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:## Not run: result <- nsga(type = "real-valued",               fitness = zdt1,               lower = c(0,0),               upper = c(1,1),               popSize = 100,               dshare = 1,               monitor = FALSE,               maxiter = 500)## End(Not run)

Virtual Class 'nsga'

Description

The 'nsga' class is the parent superclass of thensga1,nsga2, andnsga3 classes

Slots

call

an object of class 'call' representing the matched call.

type

a character string specifying the type of genetic algorithm used.

lower

a vector providing for each decision variable the lower bounds ofthe search space in case of real-valued or permutation encoded optimisations.

upper

a vector providing for each decision variable the upper bounds ofthe search space in case of real-valued or permutation encoded optimizations.

nBits

a value specifying the number of bits to be used in binaryencoded optimizations.

names

a vector of character strings providing the names of decisionvariables (optional).

popSize

the population size.

front

Rank of individuals on the non-dominated front.

f

Front of individuals on the non-dominated front.

iter

the actual (or final) iteration of NSGA search.

run

the number of consecutive generations without any improvement inthe best fitness value before the NSGA is stopped.

maxiter

the maximum number of iterations to run before the NSGA searchis halted.

suggestions

a matrix of user provided solutions and included in theinitial population.

population

the current (or final) population.

pcrossover

the crossover probability.

pmutation

the mutation probability.

fitness

the values of fitness function for the current (or final)population.

summary

a matrix of summary statistics for fitness values at eachiteration (along the rows).

fitnessValue

the best fitness value at the final iteration.

solution

the value(s) of the decision variables giving the best fitnessat the final iteration.

Objects from the Class

Since it is a virtual Class, no objects may be created from it.

Examples

showClass('nsga')

Class 'nsga1'

Description

The class 'nsga1' is instantiated within the execution of rmoo and will bereturned as a result of it. All data generated during execution will bestored in it.

Slots

dumFitness

a large dummy fitness value assigned to individuals fromthe nondominated front.

dShare

the maximun phenotypic distance allowed between any twoindividuals to become members of a niche.

deltaDummy

value to decrease the dummy fitness of individuals bynon-dominated fronts.

Examples

showClass('nsga1')

Non-Dominated Sorting in Genetic Algorithms II

Description

Minimization of a fitness function using non-dominated sorting geneticalgorithms - II (NSGA-IIs). Multiobjective evolutionary algorithms

Usage

nsga2(  type = c("binary", "real-valued", "permutation"),  fitness,  ...,  lower,  upper,  nBits,  population = nsgaControl(type)$population,  selection = nsgaControl(type)$selection,  crossover = nsgaControl(type)$crossover,  mutation = nsgaControl(type)$mutation,  popSize = 50,  nObj = ncol(fitness(matrix(10000, ncol = 100, nrow = 100))),  pcrossover = 0.8,  pmutation = 0.1,  maxiter = 100,  run = maxiter,  maxFitness = Inf,  names = NULL,  suggestions = NULL,  monitor = if (interactive()) nsgaMonitor else FALSE,  summary = FALSE,  seed = NULL)

Arguments

type

the type of genetic algorithm to be run depending on the natureof decision variables. Possible values are:

'binary'

for binary representations of decision variables.

'real-valued'

for optimization problems where the decisionvariables are floating-point representations of real numbers.

'permutation'

for problems that involves reordering of a list ofobjects.

fitness

the fitness function, any allowable R function which takes asinput an individual string representing a potential solution, and returns anumerical value describing its 'fitness'.

...

additional arguments to be passed to the fitness function. Thisallows to write fitness functions that keep some variables fixed during thesearch

lower

a vector of length equal to the decision variables providing thelower bounds of the search space in case of real-valued or permutationencoded optimizations.

upper

a vector of length equal to the decision variables providing theupper bounds of the search space in case of real-valued or permutationencoded optimizations.

nBits

a value specifying the number of bits to be used in binaryencoded optimizations

population

an R function for randomly generating an initial population.Seensga_Population() for available functions.

selection

an R function performing selection, i.e. a function whichgenerates a new population of individuals from the current populationprobabilistically according to individual fitness. Seensga_Selection()for available functions.

crossover

an R function performing crossover, i.e. a function whichforms offsprings by combining part of the genetic information from theirparents. Seensga_Crossover() for available functions.

mutation

an R function performing mutation, i.e. a function whichrandomly alters the values of some genes in a parent chromosome.Seensga_Mutation() for available functions.

popSize

the population size.

nObj

number of objective in the fitness function.

pcrossover

the probability of crossover between pairs of chromosomes.Typically this is a large value and by default is set to 0.8.

pmutation

the probability of mutation in a parent chromosome. Usuallymutation occurs with a small probability, and by default is set to 0.1.

maxiter

the maximum number of iterations to run before the NSGA searchis halted.

run

the number of consecutive generations without any improvement inthe best fitness value before the NSGA is stopped

maxFitness

the upper bound on the fitness function after that the NSGAsearch is interrupted.

names

a vector of character strings providing the names of decisionvariables.

suggestions

a matrix of solutions strings to be included in theinitial population. If provided the number of columns must match the numberof decision variables.

monitor

a logical or an R function which takes as input the currentstate of the nsga-class object and show the evolution of the search. Bydefault, for interactive sessions the function nsgaMonitor prints the averageand best fitness values at each iteration. If set to plot these informationare plotted on a graphical device. Other functions can be written by the userand supplied as argument. In non interactive sessions, by defaultmonitor = FALSE so any output is suppressed.

summary

If there will be a summary generation after generation.

seed

an integer value containing the random number generator state.This argument can be used to replicate the results of a NSGA search. Notethat if parallel computing is required, the doRNG package must be installed.

Details

The Non-dominated genetic algorithms II is a meta-heuristic proposed byK. Deb, A. Pratap, S. Agarwal and T. Meyarivan in 2002. The purpose of thealgorithms is to find an efficient way to optimize multi-objectives functions(two or more).

Value

Returns an object of class nsga2-class. Seensga2 for adescription of available slots information.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

K. Deb, A. Pratap, S. Agarwal and T. Meyarivan, 'A fast andelitist multiobjective genetic algorithm: NSGA-II,' in IEEE Transactions onEvolutionary Computation, vol. 6, no. 2, pp. 182-197, April 2002,doi: 10.1109/4235.996017.

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation,parallelisation and islands evolution. The R Journal, 9/1, 187-206.doi: 10.32614/RJ-2017-008

See Also

nsga(),nsga3()

Examples

#Example#Two Objectives - Real Valuedzdt1 <- 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:## Not run: result <- nsga2(type = "real-valued",                fitness = zdt1,                lower = c(0,0),                upper = c(1,1),                popSize = 100,                monitor = FALSE,                maxiter = 500)## End(Not run)#Example 2#Three Objectives - Real Valueddtlz1 <- 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)}#Not run:## Not run: result <- nsga2(type = "real-valued",                fitness = dtlz1,                lower = c(0,0,0), upper = c(1,1,1),                popSize = 92,                monitor = FALSE,                maxiter = 500)## End(Not run)

Class 'nsga2'

Description

The class 'nsga2' is instantiated within the execution of rmoo and will bereturned as a result of it. All data generated during execution will bestored in it.

Slots

crowdingDistance

Crowding-comparison approach to estiate of theperimeter of the cuboid formed by using the nearest neighbors as the vertices.

Examples

showClass('nsga2')

Non-Dominated Sorting in Genetic Algorithms III

Description

Minimization of a fitness function using non-dominated sorting geneticalgorithms - III (NSGA-IIIs). Multiobjective evolutionary algorithms

Usage

nsga3(  type = c("binary", "real-valued", "permutation"),  fitness,  ...,  lower,  upper,  nBits,  population = nsgaControl(type)$population,  selection = nsgaControl(type)$selection,  crossover = nsgaControl(type)$crossover,  mutation = nsgaControl(type)$mutation,  popSize = 50,  nObj = ncol(fitness(matrix(10000, ncol = 100, nrow = 100))),  n_partitions,  pcrossover = 0.8,  pmutation = 0.1,  reference_dirs = generate_reference_points,  maxiter = 100,  run = maxiter,  maxFitness = Inf,  names = NULL,  suggestions = NULL,  monitor = if (interactive()) nsgaMonitor else FALSE,  summary = FALSE,  seed = NULL)

Arguments

type

the type of genetic algorithm to be run depending on the natureof decision variables. Possible values are:

"binary"

for binary representations of decision variables.

"real-valued"

for optimization problems where the decisionvariables are floating-point representations of real numbers.

"permutation"

for problems that involves reordering of a listof objects.

fitness

the fitness function, any allowable R function which takes asinput an individual string representing a potential solution, and returns anumerical value describing its “fitness”.

...

additional arguments to be passed to the fitness function. Thisallows to write fitness functions that keep some variables fixed during thesearch

lower

a vector of length equal to the decision variables providing thelower bounds of the search space in case of real-valued or permutationencoded optimizations.

upper

a vector of length equal to the decision variables providing theupper bounds of the search space in case of real-valued or permutationencoded optimizations.

nBits

a value specifying the number of bits to be used in binaryencoded optimizations.

population

an R function for randomly generating an initial population.Seensga_Population() for available functions.

selection

an R function performing selection, i.e. a function whichgenerates a new population of individuals from the current populationprobabilistically according to individual fitness. Seensga_Selection()for available functions.

crossover

an R function performing crossover, i.e. a function whichforms offsprings by combining part of thegenetic information from their parents. Seensga_Crossover()for available functions.

mutation

an R function performing mutation, i.e. a function whichrandomly alters the values of some genes in a parent chromosome.Seensga_Mutation() for available functions.

popSize

the population size.

nObj

number of objective in the fitness function.

n_partitions

Partition number of generated reference points

pcrossover

the probability of crossover between pairs of chromosomes.Typically this is a large value and by default is set to 0.8.

pmutation

the probability of mutation in a parent chromosome. Usuallymutation occurs with a small probability, and by default is set to 0.1.

reference_dirs

Function to generate reference points using Das andDennis approach or matrix with supplied reference points.

maxiter

the maximum number of iterations to run before the NSGA searchis halted.

run

the number of consecutive generations without any improvement inthe best fitness value before the NSGA is stopped

maxFitness

the upper bound on the fitness function after that the NSGAsearch is interrupted.

names

a vector of character strings providing the names of decisionvariables.

suggestions

a matrix of solutions strings to be included in the initialpopulation. If provided the number of columns must match the number ofdecision variables.

monitor

a logical or an R function which takes as input the currentstate of the nsga-class object and show the evolution of the search.By default, for interactive sessions the function nsgaMonitor prints theaverage and best fitness values at each iteration. If set to plot theseinformation are plotted on a graphical device. Other functions can be writtenby the user and supplied as argument. In non interactive sessions, by defaultmonitor = FALSE so any output is suppressed.

summary

If there will be a summary generation after generation.

seed

an integer value containing the random number generator state.This argument can be used to replicate the results of a NSGA search. Notethat if parallel computing is required, the doRNG package must be installed.

Details

The Non-dominated genetic algorithms III is a meta-heuristic proposed byK. Deb and H. Jain in 2013.The purpose of the algorithms is to find an efficient way to optimizemulti-objectives functions (more than three).

Value

Returns an object of class nsga3-class. Seensga3 for adescription of available slots information.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

K. Deb and H. Jain, "An Evolutionary Many-Objective OptimizationAlgorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I:Solving Problems With Box Constraints," in IEEE Transactions on EvolutionaryComputation, vol. 18, no. 4, pp. 577-601, Aug. 2014,doi: 10.1109/TEVC.2013.2281535.

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation,parallelisation and islands evolution. The R Journal, 9/1, 187-206.doi: 10.32614/RJ-2017-008

See Also

nsga(),nsga2()

Examples

#Example 1#Two Objectives - Real Valuedzdt1 <- 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## Not run: result <- nsga3(type = "real-valued",                fitness = zdt1,                lower = c(0,0),                upper = c(1,1),                popSize = 100,                n_partitions = 100,                monitor = FALSE,                maxiter = 500)## End(Not run)#Example 2#Three Objectives - Real Valueddtlz1 <- 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)}#Not Run## Not run: result <- nsga3(type = "real-valued",                fitness = dtlz1,                lower = c(0,0,0),                upper = c(1,1,1),                popSize = 92,                n_partitions = 12,                monitor = FALSE,                maxiter = 500)## End(Not run)

Class 'nsga3'

Description

The class 'nsga3' is instantiated within the execution of rmoo and will bereturned as a result of it. All data generated during execution will bestored in it.

Slots

ideal_point

Nadir point estimate used as lower bound in normalization.

worst_point

Worst point generated over generations.

smin

Index used to obtain the extreme points.

extreme_points

are selected using the ASF in the (PerformScalarizing()).Necessary in the nadir point generation.

worst_of_population

The worst individuals generated by objectives inthe current generation.

worst_of_front

The worst individuals in the first front generated byobjectives in the current generation.

nadir_point

Nadir point estimate used as upper bound in normalization.

reference_points

NSGA-III uses a predefined set of reference points toensure diversity in obtained solutions.The chosen refenrece points can be predefined in structured manner orsupplied by the user. We use the Das and Dennis procedure.

Examples

showClass('nsga3')

A function for setting or retrieving defaults non-dominated genetic operators

Description

Default settings for non-dominated genetic operators used in the 'rmoo' package.

Usage

  nsgaControl(...)

Arguments

...

no arguments, a single character vector, or a named list with components.

Details

If the function is called with no arguments returns the current default settings, i.e., a list with the following default components:

The function may be called with a single string specifying the name of the component. In this case the function returns the current default settings.

To change the default values, a named component must be followed by a single value (in case of"eps") or a list of component(s) specifying the name of the function for a genetic operator. See the Examples section.

Value

If the argument list is empty the function returns the current list of values.If the argument list is not empty, the returned list is invisible.

Note

The parameter values set via a call to this function will remain in effect for the rest of the session, affecting the subsequent behaviour of the functions for which the given parameters are relevant.

Author(s)

Francisco Benitez

References

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation, parallelisation and islands evolution. The R Journal, 9/1, 187-206, doi: 10.32614/RJ-2017-008.

See Also

nsga(),nsga2() andnsga3()

Examples

  # get and save defaults  defaultControl <- nsgaControl()  print(defaultControl)  # get current defaults only for real-valued search  nsgaControl("real-valued")  # set defaults for selection operator of real-valued search  nsgaControl("real-valued" = list(selection = "nsgareal_lrSelection"))  nsgaControl("real-valued")  # set defaults for selection and crossover operators of real-valued search  nsgaControl("real-valued" = list(selection = "nsgareal_lrSelection",                                   crossover = "nsgareal_spCrossover"))  nsgaControl("real-valued")  # restore defaults  nsgaControl(defaultControl)  nsgaControl()

Monitor non-dominated genetic algorithm evolution

Description

Functions to plotting fitness values at each iteration of a search for the 'rmoo' package.

Usage

  nsgaMonitor(object, number_objectives, ...)

Arguments

object

an object of classnsga,nsga2 ornsga3, usually resulting from a call to functionnsga,nsga2 ornsga3, respectively.

number_objectives

numbers of objective values of the function to evaluate.

...

further arguments passed to or from other methods.

Value

These functions plot the fitness values of the current step of the nsga3 on the console.
By default,nsgaMonitor is called in interactive sessions bynsga,nsga2, ornsga3.
The function can be modified by the user to plot or print the values it considers by iteration.

Author(s)

Francisco Benitez

References

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation, parallelisation and islands evolution. The R Journal, 9/1, 187-206, doi: 10.32614/RJ-2017-008.

See Also

nsga(),nsga2() andnsga3()


Crossover operators in non-dominated genetic algorithms

Description

Functions implementing crossover non-dominated genetic operator.

Usage

  nsga_spCrossover(object, parents)  nsgabin_spCrossover(object, parents)  nsgareal_spCrossover(object, parents)  nsgareal_sbxCrossover(object, parents, nc = 20)  nsgaperm_oxCrossover(object, parents)

Arguments

object

An object of class"nsga","nsga2" and"nsga3", usually resulting from a call to functionnsga,nsga2 andnsga3.

parents

A two-rows matrix of values indexing the parents from the current population.

nc

Parameters of non-dominated genetic operators.

Value

Return a list with two elements:

children

a matrix of dimension 2 times the number of decision variables containing the generated offsprings;

fitness

a vector of length 2 containing the fitness values for the offsprings. A valueNA is returned if an offspring is different (which is usually the case) from the two parents.

Author(s)

Francisco Benitez

References

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation, parallelisation and islands evolution. The R Journal, 9/1, 187-206, doi: 10.32614/RJ-2017-008.

See Also

nsga(),nsga2() andnsga3()


Mutation operators in non-dominated genetic algorithms

Description

Functions implementing mutation non-dominated genetic operator.

Usage

  nsgabin_raMutation(object, parent)  nsgareal_raMutation(object, parent)  nsgareal_polMutation(object, parent, nm = 0.20)  nsgaperm_simMutation(object, parent)

Arguments

object

An object of class"nsga","nsga2" or"nsga3" usually resulting from a call to functionnsga,nsga2,nsga3.

parent

A vector of values for the parent from the current population where mutation should occur.

nm

Parameters of genetic operators.

Value

Return a vector of values containing the mutated string.

Author(s)

Francisco Benitez

References

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation, parallelisation and islands evolution. The R Journal, 9/1, 187-206, doi: 10.32614/RJ-2017-008.


Population initialization in non-dominated genetic algorithms

Description

Functions for creating a random initial population to be used in non-dominated genetic algorithms.

Usage

  nsgabin_Population(object)  nsgareal_Population(object)  nsgaperm_Population(object)

Arguments

object

An object of classnsga-class,nsga2-class ornsga3-class.

Details

nsgabin_Population generates a random population ofobject@nBits binary values;

nsgareal_Population generates a random (uniform) population of real values in the range [object@lower,object@upper];

nsgaperm_Population generates a random (uniform) population of integer values in the range [object@lower,object@upper].

Value

Return a matrix of dimensionobject@popSize times the number of decision variables.

Author(s)

Francisco Benitez

References

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation, parallelisation and islands evolution. The R Journal, 9/1, 187-206, doi: 10.32614/RJ-2017-008.

See Also

nsga,nsga2 andnsga3


Selection operators in non-dominated genetic algorithms

Description

Functions implementing selection non-dominated genetic operator.

Usage

  nsga_lrSelection(object, r, q)  nsga_tourSelection(object, k = 3, ...)  nsgabin_lrSelection(object, r, q)  nsgabin_tourSelection(object, k = 3, ...)  nsgareal_lrSelection(object, r, q)  nsgareal_tourSelection(object, k = 3, ...)  nsgaperm_lrSelection(object, r, q)  nsgaperm_tourSelection(object, k = 3, ...)

Arguments

object

An object of class"nsga","nsga2" or"nsga3", usually resulting from a call to functionnsga,nsga2 ornsga3.

r

A tuning parameter for the specific selection operator.

q

A tuning parameter for the specific selection operator.

k

A tuning parameter for the specific selection operator.

...

Further arguments passed to or from other methods.

Value

Return a list with two elements:

population

a matrix of dimensionobject@popSize times the number of decision variables containing the selected individuals or strings;

fitness

a vector of lengthobject@popSize containing the fitness values for the selected individuals.

Author(s)

Francisco Benitez

References

Scrucca, L. (2017) On some extensions to 'GA' package: hybrid optimisation, parallelisation and islands evolution. The R Journal, 9/1, 187-206, doi: 10.32614/RJ-2017-008.

See Also

nsga(),nsga2() andnsga3()


Virtual Class 'numberOrNAOrMatrix - Simple Class for subassigment Values'

Description

The class 'numberOrNAOrMatrix' is a simple class union (setClassUnion())of 'numeric', 'logical', 'logical' and 'matrix'.

Objects from the Class

Since it is a virtual Class, no objects may be created from it.

Examples

showClass('numberOrNAOrMatrix')

Objective Values performance metrics

Description

Functions to evaluate the quality of the results obtained by the algorithms, evaluating their diversity and convergence, providing or not some parameters to compare.

Usage

  generational_distance(fitness, reference_points)

Arguments

fitness

Objective values generated by the algorithm.

reference_points

Optimal points to achieve.

Value

A vector with the measurement parameter.

Author(s)

Francisco Benitez

References

Lamont, G., & Veldhuizen, D.V. (1999). Multiobjective evolutionary algorithms: classifications, analyses, and new innovations.


Methods for Function 'plot' in Package 'rmoo'

Description

Method used to visualize the fitness of the individuals during the executionof the algorithms.

Usage

plot(x, y, ...)## S4 method for signature 'nsga,missing'plot(x, y = "missing", type = c("scatter", "pcp", "heatmap", "polar"), ...)## S4 method for signature 'nsga1,missing'plot(x, y = "missing", type = c("scatter", "pcp", "heatmap", "polar"), ...)## S4 method for signature 'nsga2,missing'plot(x, y = "missing", type = c("scatter", "pcp", "heatmap", "polar"), ...)## S4 method for signature 'nsga3,missing'plot(x, y = "missing", type = c("scatter", "pcp", "heatmap", "polar"), ...)

Arguments

x,y

Objects of either classnsga1,nsga2, ornsga3.

...

other arguments passed on to methods

"optimal"

An argument passed to the "scatter" plot. A matrix ofdimension equal to the fitness with which they are compared. This value canonly be compared in 2 and 3 dimensional "scatter" plots.

"individual"

An argument passed to the "heatmap" and "polar" plots.A vector that represents the fitness of the individuals to be displayed.

type

Type of graph to draw, the graphs can be of the type "scatter","pcp", "heatmap", or "polar"

Details

The following plots are available:

Value

A graph of the evaluated type.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

Examples

# Where 'out' is an object of class nsga1, nsga2, or nsga3.# The plot method will by default plot a scatter plot.## plot(out)## The Parallel Coordinate Plot will be plotted if "pcp" is passed as a parameter to "type".## plot(out, type="pcp")## A heat map plot will be plotted if "heatmap" is passed as a parameter to "type"# and a vector with the individuals to plot to "individual"## plot(out, type = "heatmap", individual = c(1:5))## A polar coordinate plot will be plotted if "polar" is passed as a parameter to "type"# and a vector with the individuals to plot to "individual"## plot(out, type = "polar", individual = c(1:5))

Methods for Function 'print' in Package 'rmoo'.

Description

Method used to print the slots and relevant values of the object.

Usage

print(x, ...)## S4 method for signature 'nsga'print(x, ...)## S4 method for signature 'nsga1'print(x, ...)## S4 method for signature 'nsga3'print(x, ...)

Arguments

x

Objects of either classnsga1,nsga2, ornsga3.

...

other arguments passed on to methods

Value

Print the slots and relevant values of the object.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

Examples

# Where 'out' is an object of class nsga1, nsga2, or nsga3## print(out)

Methods for Function 'progress' in Package 'rmoo'

Description

Method used to save the progress of the evaluation results, similar to thesummary method. Passing additional arguments to the progress method evaluatesperformance metrics per iteration. This method cannot be called outside ofrmoo execution.

Usage

progress(object, ...)## S4 method for signature 'nsga'progress(object, ...)## S4 method for signature 'nsga1'progress(object, ...)## S4 method for signature 'nsga2'progress(object, ...)## S4 method for signature 'nsga3'progress(object, ...)

Arguments

object

Objects of either classnsga1,nsga2, ornsga3.

...

other arguments passed on to methods. Passing"reference_dirs"as arguments will evaluate the performance metrics Hypervolumen,Generational Distance, and Inverse Generational Distance.

Value

A list of length equal to the number of iterations, where the progress made during execution is saved.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

Examples

# Where 'out' is an object of class nsga1, nsga2, or nsga3, and callArgs are# the additional arguments passed when calling the rmoo function, for the# evaluation of performance metrics, reference points are expected to be passed# as an argument to reference_dirs.## progress(object, callArgs)#

Determination of Multi-layer Reference Points

Description

A implementation of Multi-layer Reference Points Generation.

Usage

reference_point_multi_layer(...)

Arguments

...

The different layers provided by the user

Details

The Multi-layer reference point implementation is based on Blank and Deb'spymoo library, the approach generates different layers of references pointat different scales, provided by the user.

Value

A matrix with the multi-layer reference points

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

J. Blank and K. Deb, "Pymoo: Multi-Objective Optimization inPython," in IEEE Access, vol. 8, pp. 89497-89509, 2020,doi: 10.1109/ACCESS.2020.2990567.

Das, Indraneel & Dennis, J. (2000). Normal-Boundary Intersection: A NewMethod for Generating the Pareto Surface in Nonlinear MulticriteriaOptimization Problems. SIAM Journal on Optimization. 8.10.1137/S1052623496307510.

See Also

generate_reference_points() andget_fixed_rowsum_integer_matrix()


R Multi-Objective Optimization Main Function

Description

Main function of rmoo, based on the parameters it will call the differentalgorithms implemented in the package. Optimization algorithms will minimizea fitness function. For more details of the algorithmsseensga(),nsga2(),nsga3().

Usage

rmoo(...)

Arguments

...

argument in which all the values necessary for the configurationwill be passed as parameters. The user is encouraged to see the documentationsofnsga(),nsga2(),nsga3() in which the necessary parameters for eachalgorithm are cited, in addition, the chosen strategy to execute must bepassed as an argument. This can be seen more clearly in the examples.

Details

Multi- and Many-Optimization of a fitness function using Non-dominatedSorting Genetic Algorithms. The algorithms currently implemented by rmooare: NSGA-I, NSGA-II and NSGA-III

The original Non-dominated Sorting Genetic Slgorithms (NSGA-I)is ameta-heuristic proposed by N. Srinivas and K. Deb in 1994. The purpose ofthe algorithms is to find an efficient way to optimize multi-objectivesfunctions (two or more).

The Non-dominated genetic algorithms II (NSGA-II) is a meta-heuristic proposed byK. Deb, A. Pratap, S. Agarwal and T. Meyarivan in 2002. The purpose of thealgorithms is to find an efficient way to optimize multi-objectives functions(two or more).

The Non-dominated genetic algorithms III (NSGA-III) is a meta-heuristic proposed byK. Deb and H. Jain in 2013.The purpose of the algorithms is to find an efficient way to optimizemulti-objectives functions (more than three).

Value

Returns an object of class ga-class, nsga1-class, nsga2-class ornsga3-class. Seensga1,nsga2,nsga3 for a description ofavailable slots information.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

Scrucca, L. (2017) On some extensions to 'GA' package: hybridoptimisation, parallelisation and islands evolution. The R Journal, 9/1, 187-206.doi: 10.32614/RJ-2017-008

N. Srinivas and K. Deb, "Multiobjective Optimization UsingNondominated Sorting in Genetic Algorithms, in Evolutionary Computation,vol. 2, no. 3, pp. 221-248, Sept. 1994, doi: 10.1162/evco.1994.2.3.221.

K. Deb, A. Pratap, S. Agarwal and T. Meyarivan, 'A fast andelitist multiobjective genetic algorithm: NSGA-II,' in IEEE Transactions onEvolutionary Computation, vol. 6, no. 2, pp. 182-197, April 2002,doi: 10.1109/4235.996017.

K. Deb and H. Jain, "An Evolutionary Many-Objective OptimizationAlgorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I:Solving Problems With Box Constraints," in IEEE Transactions on EvolutionaryComputation, vol. 18, no. 4, pp. 577-601, Aug. 2014,doi: 10.1109/TEVC.2013.2281535.

See Also

nsga(),nsga2(),nsga3()

Examples

#Example 1#Two Objectives - Real Valuedzdt1 <- 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:## Not run: result <- rmoo(type = "real-valued",               fitness = zdt1,               strategy = "NSGA-I",               lower = c(0,0),               upper = c(1,1),               popSize = 100,               dshare = 1,               monitor = FALSE,               maxiter = 500)## End(Not run)#Example 2#Three Objectives - Real Valueddtlz1 <- 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)}#Not run:## Not run: result <- rmoo(type = "real-valued",                fitness = dtlz1,                strategy = "NSGA-II",                lower = c(0,0,0),                upper = c(1,1,1),                popSize = 92,                monitor = FALSE,                maxiter = 500)## End(Not run)#Example 3#Two Objectives - Real Valuedzdt1 <- 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## Not run: result <- rmoo(type = "real-valued",                fitness = zdt1,                strategy = "NSGA-III",                lower = c(0,0),                upper = c(1,1),                popSize = 100,                n_partitions = 100,                monitor = FALSE,                maxiter = 500)## End(Not run)#Example 4#Three Objectives - Real Valueddtlz1 <- 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)}#Not Run## Not run: result <- rmoo(type = "real-valued",                fitness = dtlz1,                strategy = "NSGA-III",                lower = c(0,0,0),                upper = c(1,1,1),                popSize = 92,                n_partitions = 12,                monitor = FALSE,                maxiter = 500)## End(Not run)#Example 5#Single Objective - Real Valuedf <- function(x,  ...)  (x^2+x)*cos(x)#Not Run## Not run: result <- rmoo(type = "real-valued",               fitness = f,               strategy = "GA",               lower = -20,               upper = 20,               maxiter = 100)## End(Not run)

Scale Reference Points

Description

A implementation of Das and Dennis's Reference Points Generation.

Usage

scale_reference_directions(ref_dirs, scaling)

Arguments

ref_dirs,scaling

where 'ref_dirs' are the reference points generated and'scaling' are the scale on which the points are distributed.

Details

The implemented Reference Point Generation is based on the Das and Dennis'ssystematic approach that places points on a normalized hyper-plane which isequally inclined to all objective axes and has an intercept of one on each axis.

Value

A matrix with rescaled reference points uniformly distributed.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

J. Blank and K. Deb, "Pymoo: Multi-Objective Optimization in Python," inIEEE Access, vol. 8, pp. 89497-89509, 2020, doi: 10.1109/ACCESS.2020.2990567.

See Also

generate_reference_points() andget_fixed_rowsum_integer_matrix()


Calculation of Dummy Fitness

Description

Calculate of sharing distance and dummy fitness

Usage

sharing(object)

Arguments

object

An object of class 'nsga', usually resulting from a call tofunction nsga. Fitness Function Objective Numbers.

Details

The sharing distance operator guides the selection process at the variousstages of the algorithm toward a uniformly spread-out Pareto-optimal front

Value

A vector with the dummy fitness.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

References

N. Srinivas and K. Deb, 'Multiobjective Optimization UsingNondominated Sorting in Genetic Algorithms,' in Evolutionary Computation,vol. 2, no. 3, pp. 221-248, Sept. 1994, doi: 10.1162/evco.1994.2.3.221.

See Also

non_dominated_fronts()


Methods for Function 'summary' in Package 'rmoo'

Description

Method used to summarize the results of the evaluations, passing additionalarguments in the summary method the performance metrics is evaluated.

Usage

summary(object, ...)## S4 method for signature 'nsga'summary(object, ...)## S4 method for signature 'nsga1'summary(object, ...)## S4 method for signature 'nsga2'summary(object, ...)## S4 method for signature 'nsga3'summary(object, ...)

Arguments

object

Objects of either classnsga1,nsga2, ornsga3.

...

other arguments passed on to methods. Passing"reference_dirs"as arguments will evaluate the performance metrics Hypervolumen,Generational Distance, and Inverse Generational Distance.

Value

A summary of the values resulting from the execution of an algorithm.

Author(s)

Francisco Benitezbenitezfj94@gmail.com

Examples

# Where 'out' is an object of class nsga1, nsga2, or nsga3## summary(out)## For the evaluation of the metrics, pass the reference point## ref_points <- generate_reference_points(3,12)# summary(out, reference_dirs = ref_points)

Adaptive normalization of population members

Description

Functions to scalarize the members of the population to locate them in a normalized hyperplane, finding the ideal point, nadir point, worst point and the extreme points.

Usage

  UpdateIdealPoint(object, nObj)  UpdateWorstPoint(object, nObj)  PerformScalarizing(population, fitness, smin, extreme_points, ideal_point)  get_nadir_point(object)

Arguments

object

An object of class"nsga3".

nObj

numbers of objective values of the function to evaluate.

population

individuals of the population until last front.

fitness

objective values of the population until last front.

smin

Achievement Escalation Function Index.

extreme_points

Extreme points of the previous generation to upgrade.

ideal_point

Ideal point of the current generation to translate objectives.

Value

Return scalarized objective values in a normalized hyperplane.

Author(s)

Francisco Benitez

References

J. Blank and K. Deb, "Pymoo: Multi-Objective Optimization in Python," in IEEE Access, vol. 8, pp. 89497-89509, 2020, doi: 10.1109/ACCESS.2020.2990567.

K. Deb and H. Jain, "An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I: Solving Problems With Box Constraints," in IEEE Transactions on Evolutionary Computation, vol. 18, no. 4, pp. 577-601, Aug. 2014, doi: 10.1109/TEVC.2013.2281535.


[8]ページ先頭

©2009-2025 Movatter.jp