MutatorNumeric | R Documentation |
Base class for mutation operations on numeric and integer valued individuals, inheriting from Mutator
.
MutatorNumeric
operators perform mutation on numeric (integer and real valued) individuals. Inheriting
operators implement the private $.mutate_numeric()
function that is called once for each individual
and is given a numeric vector.
MutatorNumeric
is an abstract base class and should be inherited from. Inheriting classes should implement the private $.mutate_numeric()
function. During $operate()
, the $.mutate_numeric()
function is called once for each individual, with the parameters values
(the
individual as a single numeric
vector), lowers
and uppers
(numeric
vectors, the lower and upper bounds for each component of values
). Typically,
$initialize()
should also be overloaded.
MutatorNumeric
s that perform real-valued operations, such as e.g. MutatorGauss
, operate on integers by widening the lower and upper bounds
of integer components by 0.5, applying their operation, and rounding resulting values to the nearest integer (while always staying inside bounds).
miesmuschel::MiesOperator
-> miesmuschel::Mutator
-> MutatorNumeric
new()
Initialize base class components of the MutatorNumeric
.
MutatorNumeric$new( param_classes = c("ParamInt", "ParamDbl"), param_set = ps(), packages = character(0), dict_entry = NULL, own_param_set = quote(self$param_set) )
param_classes
(character
)
Classes of parameters that the operator can handle. May contain any of "ParamInt"
, "ParamDbl"
.
Default is both of them.
The $param_classes
field will reflect this value.
param_set
(ParamSet
| list
of expression
)
Strategy parameters of the operator. This should be created by the subclass and given to super$initialize()
.
If this is a ParamSet
, it is used as the MiesOperator
's ParamSet
directly. Otherwise it must be a list
of expressions e.g. created by alist()
that evaluate to ParamSet
s,
possibly referencing self
and private
.
These ParamSet
are then combined using a ParamSetCollection
.
Default is the empty ParamSet
.
The $param_set
field 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 is character(0)
.
The $packages
field will reflect this values.
dict_entry
(character(1)
| NULL
)
Key of the class inside the Dictionary
(usually one of
dict_mutators
, dict_recombinators
, dict_selectors
), where it can
be retrieved using a short access function. May be NULL
if the operator
is not entered in a dictionary.
The $dict_entry
field will reflect this value.
own_param_set
(language
)
An expression that evaluates to a ParamSet
indicating the configuration parameters that are entirely owned by
this operator class (and not proxied from a construction argument object). This should be quote(self$param_set)
(the default) when
the param_set
argument is not a list of expressions.
clone()
The objects of this class are cloneable with this method.
MutatorNumeric$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other base classes:
Filtor
,
FiltorSurrogate
,
MiesOperator
,
Mutator
,
MutatorDiscrete
,
OperatorCombination
,
Recombinator
,
RecombinatorPair
,
Scalor
,
Selector
,
SelectorScalar
Other mutators:
Mutator
,
MutatorDiscrete
,
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.