| Recombinator {miesmuschel} | R Documentation |
Recombinator Base Class
Description
Base class representing recombination operations, inheriting from MiesOperator.
Recombinators get a table of individuals as input and return a table of modified individuals as output. Individuals are acted on by
groups: every $n_indivs_out lines of output corresponds to a group of $n_indivs_in lines of input, and presence or absence
of other input groups does not affect the result.
Recombination operations are performed in ES algorithms to facilitate exploration of the search space that combine partial solutions.
Inheriting
Recombinator is an abstract base class and should be inherited from. Inheriting classes should implement the private $.recombine()
function. The user of the object calls $operate(), which calls $.recombine() for each $n_indivs_in sized group of individuals after checking that
the operator is primed, that the values argument conforms to the primed domain. $.recombine() should then return a table of
$n_indivs_out individuals for each call. Typically, the $initialize() function
should also be overloaded, and optionally the $prime() function; they should call their super equivalents.
Super class
miesmuschel::MiesOperator -> Recombinator
Active bindings
n_indivs_in(
integer(1))
Number of individuals to consider at the same time. When operating, the number of input individuals must be divisible by this number.n_indivs_out(
integer(1))
Number of individuals produced for each group of$n_indivs_inindividuals.
Methods
Public methods
Inherited methods
Method new()
Initialize base class components of the Recombinator.
Usage
Recombinator$new(
param_classes = c("ParamLgl", "ParamInt", "ParamDbl", "ParamFct"),
param_set = ps(),
n_indivs_in = 2,
n_indivs_out = n_indivs_in,
packages = character(0),
dict_entry = NULL,
own_param_set = quote(self$param_set)
)Arguments
param_classes(
character)
Classes of parameters that the operator can handle. May contain any of"ParamLgl","ParamInt","ParamDbl","ParamFct". Default is all of them.
The$param_classesfield will reflect this value.param_set(
ParamSet|listofexpression)
Strategy parameters of the operator. This should be created by the subclass and given tosuper$initialize(). If this is aParamSet, it is used as theMiesOperator'sParamSetdirectly. Otherwise it must be alistof expressions e.g. created byalist()that evaluate toParamSets, possibly referencingselfandprivate. TheseParamSetare then combined using aParamSetCollection. Default is the emptyParamSet.
The$param_setfield will reflect this value.n_indivs_in(
integer(1))
Number of individuals to consider at the same time. When operating, the number of input individuals must be divisible by this number. Default 2.
The$n_indivs_infield will reflect this value.n_indivs_out(
integer(1))
Number of individuals that result for eachn_indivs_inlines of input. The number of results from the recombinator will benrow(values) / n_indivs_in * n_indivs_out. Default equal ton_indivs_in.
The$n_indivs_outfield will reflect this value.packages(
character) Packages that need to be loaded for the operator to function. This should be declared so these packages can be loaded when operators run on parallel instances. Default ischaracter(0).
The$packagesfield will reflect this values.dict_entry(
character(1)|NULL)
Key of the class inside theDictionary(usually one ofdict_mutators,dict_recombinators,dict_selectors), where it can be retrieved using a short access function. May beNULLif the operator is not entered in a dictionary.
The$dict_entryfield will reflect this value.own_param_set(
language)
An expression that evaluates to aParamSetindicating the configuration parameters that are entirely owned by this operator class (and not proxied from a construction argument object). This should bequote(self$param_set)(the default) when theparam_setargument is not a list of expressions.
Method clone()
The objects of this class are cloneable with this method.
Usage
Recombinator$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
See Also
Other base classes:
Filtor,
FiltorSurrogate,
MiesOperator,
Mutator,
MutatorDiscrete,
MutatorNumeric,
OperatorCombination,
RecombinatorPair,
Scalor,
Selector,
SelectorScalar
Other recombinators:
OperatorCombination,
RecombinatorPair,
dict_recombinators_cmpmaybe,
dict_recombinators_convex,
dict_recombinators_cvxpair,
dict_recombinators_maybe,
dict_recombinators_null,
dict_recombinators_proxy,
dict_recombinators_sbx,
dict_recombinators_sequential,
dict_recombinators_swap,
dict_recombinators_xonary,
dict_recombinators_xounif