Learn R Programming

rmoo (version 0.2.0)

nsgaControl: 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(...)

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.

Arguments

...

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

Author

Francisco Benitez

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.

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

Run this code
  # 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()

Run the code above in your browser using DataLab