R/core.makeSelector.R

Defines functions makeSelector ms

#' @title
#' Construct a selection operator.
#'
#' @description
#' Helper function which defines a selector method, i. e., an operator which
#' takes the population and returns a part of it for mating or survival.
#'
#' @param selector [\code{function}]\cr
#'   Actual selection operator.
#' @param supported [\code{character}]\cr
#'   Vector of strings/names of supported parameter representations. Possible choices:
#'   \dQuote{permutation}, \dQuote{float}, \dQuote{binary} or \dQuote{custom}.
#' @param supported.objectives [\code{character}]\cr
#'   At least one of \dQuote{single-objective} or \dQuote{multi-objective}.
#' @param supported.opt.direction [\code{character(1-2)}]\cr
#'   Does the selector work for maximization tasks xor minimization tasks or both?
#'   Default is \dQuote{\code{minimize}}, which means that the selector selects
#'   in favour of low fitness values.
#' @return [\code{ecr_selector}]
#'   Selector object.
#' @export
makeSelector = function(
  name = "Selector",
  params,
  fun,
  minimize,
  setting,
  direction) {
  EASelector$new(
    name = name, params = params, fun = fun,
    minimize = minimize, setting = setting, direction = direction)
}

ms = function(...) {
  makeSelector(...)
}
jakobbossek/ecr3 documentation built on Nov. 14, 2019, 7:47 p.m.