Learn R Programming

miesmuschel (version 0.0.4-3)

dict_selectors_proxy: Proxy-Selector that Selects According to its Configuration Parameter

Description

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

Arguments

Configuration Parameters

  • operation :: Selector
    Operation to perform. Initialized to SelectorBest. This is primed when $prime() of SelectorProxy is called, and also when $operate() is called, to make changing the operation as part of self-adaption possible. However, if the same operation gets used inside multiple SelectorProxy objects, then it is recommended to $clone(deep = TRUE) the object before assigning them to operation to avoid frequent re-priming.

Supported Operand Types

Supported Domain classes are: p_lgl ('ParamLgl'), p_int ('ParamInt'), p_dbl ('ParamDbl'), p_fct ('ParamFct')

Dictionary

This Selector can be created with the short access form sel() (sels() to get a list), or through the the dictionary dict_selectors in the following way:

# preferred:
sel("proxy")
sels("proxy")  # takes vector IDs, returns list of Selectors

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

Super classes

miesmuschel::MiesOperator -> miesmuschel::Selector -> SelectorProxy

Methods

Inherited methods


Method new()

Initialize the SelectorProxy object.

Usage

SelectorProxy$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

SelectorProxy$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

SelectorProxy$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

See Also

Other selectors: Selector, SelectorScalar, dict_selectors_best, dict_selectors_maybe, dict_selectors_null, dict_selectors_random, dict_selectors_sequential, dict_selectors_tournament

Other selector wrappers: dict_selectors_maybe, dict_selectors_sequential

Examples

Run this code
set.seed(1)
sp = sel("proxy")
p = ps(x = p_dbl(-5, 5))
# dummy data; note that SelectorBest does not depend on data content
data = data.frame(x = rep(0, 5))
fitnesses = c(1, 5, 2, 3, 0)

sp$param_set$values$operation = sel("random")
sp$prime(p)
sp$operate(data, fitnesses, 2)

sp$param_set$values$operation = sel("best")
sp$operate(data, fitnesses, 2)

Run the code above in your browser using DataLab