nsgaControl: A function for setting or retrieving defaults non-dominated...

View source: R/nsgaControl.R

nsgaControlR Documentation

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:

  • "binary"

    • population = "nsgabin_Population"

    • selection = "nsgabin_tourSelection"

    • crossover = "nsgabin_spCrossover"

    • mutation = "nsgabin_raMutation"

  • "real-valued"

    • population = "nsgareal_Population"

    • selection = "nsgareal_tourSelection"

    • crossover = "nsgareal_sbxCrossover"

    • mutation = "nsgareal_polMutation"

  • "permutation"

    • population = "nsgaperm_Population"

    • selection = "nsgaperm_tourSelection"

    • crossover = "nsgaperm_oxCrossover"

    • mutation = "nsgaperm_simMutation"

  • "eps" = the tolerance value used by the package functions. By default set at sqrt(.Machine$double.eps).

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() and nsga3()

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()

rmoo documentation built on Sept. 24, 2022, 9:05 a.m.