#' @title
#' Construct a recombination operator.
#'
#' @description
#' Helper function which constructs a recombinator, i. e., a recombination operator.
#'
#' @note If a recombinator returns more than one child, the \code{multiple.children}
#' parameter needs to be \code{TRUE}, which is the default. In case of multiple
#' children produced these have to be placed within a list.
#'
#' @param recombinator [\code{function}]\cr
#' Actual mutation 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 n.parents [\code{integer(1)}]\cr
#' Number of parents supported.
#' @param n.children [\code{integer(1)}]\cr
#' How many children does the recombinator produce?
#' Default is \code{1}.
#' @return [\code{ecr_recombinator}]
#' Recombinator object.
#' @export
makeRecombinator = function(
name = "Recombinator",
fun,
params,
representations,
n.parents = 2L,
n.children = NULL) {
EARecombinator$new(
name = name, params = params, fun = fun, representations = representations,
n.parents, n.children = n.children)
}
mr = function(...) {
makeRecombinator(...)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.