dict_mutators_proxy {miesmuschel}R Documentation

Proxy-Mutator that Mutates According to its Configuration parameter

Description

Mutator that performs the operation in its operation configuration parameter. This is useful, e.g., to make OptimizerMies's mutation operation fully parametrizable.

Configuration Parameters

Supported Operand Types

Supported Param classes are: ParamLgl, ParamInt, ParamDbl, ParamFct

Dictionary

This Mutator can be created with the short access form mut() (muts() to get a list), or through the the dictionary dict_mutators in the following way:

# preferred:
mut("proxy")
muts("proxy")  # takes vector IDs, returns list of Mutators

# long form:
dict_mutators$get("proxy")

Super classes

miesmuschel::MiesOperator -> miesmuschel::Mutator -> MutatorProxy

Methods

Public methods

Inherited methods

Method new()

Initialize the MutatorProxy object.

Usage
MutatorProxy$new()

Method prime()

See MiesOperator method. Primes both this operator, as well as the operator given to the operation configuration parameter. Note that this modifies the ⁠$param_set$values$operation⁠ object.

Usage
MutatorProxy$prime(param_set)
Arguments
param_set

(ParamSet)
Passed to MiesOperator⁠$prime()⁠.

Returns

invisible self.


Method clone()

The objects of this class are cloneable with this method.

Usage
MutatorProxy$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other mutators: MutatorDiscrete, MutatorNumeric, Mutator, OperatorCombination, dict_mutators_cmpmaybe, dict_mutators_erase, dict_mutators_gauss, dict_mutators_maybe, dict_mutators_null, dict_mutators_sequential, dict_mutators_unif

Other mutator wrappers: OperatorCombination, dict_mutators_cmpmaybe, dict_mutators_maybe, dict_mutators_sequential

Examples

set.seed(1)
mp = mut("proxy", operation = mut("gauss", sdev = 0.1))
p = ps(x = p_int(-5, 5), y = p_dbl(-5, 5))
data = data.frame(x = rep(0, 5), y = rep(0, 5))

mp$prime(p)
mp$operate(data)

mp$param_set$values$operation = mut("null")
mp$operate(data)

[Package miesmuschel version 0.0.3 Index]