dict_selectors_null: Null Selector

dict_selectors_nullR Documentation

Null Selector

Description

Selector that disregards fitness and individual values and selects individuals by order in which they are given.

Configuration Parameters

  • shuffle_selection :: logical(1)
    Whether to shuffle the selected output. When this is TRUE, selected individuals are returned in random order, so when this operator is e.g. used in mies_generate_offspring(), then subsequent recombination operators effectively operate on pairs (or larger groups) of random individuals. Otherwise they are returned in order, and recombination operates on the first batch of n_indivs_in returned individuals first, then the second batch etc. in order. Initialized to TRUE (recommended).

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("null")
sels("null")  # takes vector IDs, returns list of Selectors

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

Super classes

miesmuschel::MiesOperator -> miesmuschel::Selector -> SelectorNull

Methods

Public methods

Inherited methods

Method new()

Initialize the SelectorNull object.

Usage
SelectorNull$new()

Method clone()

The objects of this class are cloneable with this method.

Usage
SelectorNull$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_proxy, dict_selectors_random, dict_selectors_sequential, dict_selectors_tournament

Examples

sn = sel("null")
p = ps(x = p_dbl(-5, 5))
# dummy data; note that SelectorNull does not depend on data content
data = data.frame(x = rep(0, 5))
fitnesses = c(1, 5, 2, 3, 0)

sn$prime(p)

sn$operate(data, fitnesses, 2)
sn$operate(data, fitnesses, 4)
sn$operate(data, fitnesses, 6)

miesmuschel documentation built on Sept. 11, 2024, 8:23 p.m.