| Mutator {miesmuschel} | R Documentation |
Mutator Base Class
Description
Base class representing mutation operations, inheriting from MiesOperator.
Mutations get a table of individuals as input and return a table of modified individuals as output. Individuals are acted on as individuals: every line of output corresponds to the same line of input, and presence or absence of other input lines does not affect the result.
Mutation operations are performed in ES algorithms to facilitate exploration of the search space around individuals.
Inheriting
Mutator is an abstract base class and should be inherited from. Inheriting classes should implement the private $.mutate()
function. The user of the object calls $operate(), and the arguments are passed on to private $.mutate() after checking that
the operator is primed, and that the values argument conforms to the primed domain. Typically, the $initialize() function
should also be overloaded, and optionally the $prime() function; they should call their super equivalents.
In many cases, it is advisable to inherit from one of the abstract subclasses, such as MutatorNumeric, or MutatorDiscrete.
Super class
miesmuschel::MiesOperator -> Mutator
Methods
Public methods
Inherited methods
Method new()
Initialize base class components of the Mutator.
Usage
Mutator$new(
param_classes = c("ParamLgl", "ParamInt", "ParamDbl", "ParamFct"),
param_set = ps(),
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.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
Mutator$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
See Also
Other base classes:
Filtor,
FiltorSurrogate,
MiesOperator,
MutatorDiscrete,
MutatorNumeric,
OperatorCombination,
Recombinator,
RecombinatorPair,
Scalor,
Selector,
SelectorScalar
Other mutators:
MutatorDiscrete,
MutatorNumeric,
OperatorCombination,
dict_mutators_cmpmaybe,
dict_mutators_erase,
dict_mutators_gauss,
dict_mutators_maybe,
dict_mutators_null,
dict_mutators_proxy,
dict_mutators_sequential,
dict_mutators_unif