dict_recombinators_xounif: Crossover Recombinator

dict_recombinators_xounifR Documentation

Crossover Recombinator

Description

Values between two individuals are exchanged with component-wise independent probability.

This is a pseudo-class: It does not create a single R6-object of a class; instead, it creates the object rec("cmpmaybe", rec("swap"), p = 0.5), making use of the RecombinatorCmpMaybe and RecombinatorSwap operators.

Usage

RecombinatorCrossoverUniform(keep_complement = TRUE)

Arguments

keep_complement

(logical(1))
Whether the operation should keep both resulting individuals (TRUE), or only the first and discard the complement (FALSE). Default TRUE. The ⁠$keep_complement⁠ field will reflect this value.

Value

an object of class Recombinator: rec("cmpmaybe", rec("swap")).

Supported Operand Types

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

Dictionary

This Recombinator can be created with the short access form rec() (recs() to get a list), or through the the dictionary dict_recombinators in the following way:

# preferred:
rec("xounif")
recs("xounif")  # takes vector IDs, returns list of Recombinators

# long form:
dict_recombinators$get("xounif")

See Also

Other recombinators: OperatorCombination, Recombinator, RecombinatorPair, dict_recombinators_cmpmaybe, dict_recombinators_convex, dict_recombinators_cvxpair, dict_recombinators_maybe, dict_recombinators_null, dict_recombinators_proxy, dict_recombinators_sbx, dict_recombinators_sequential, dict_recombinators_swap, dict_recombinators_xonary

Examples

set.seed(1)
rx = rec("xounif")

print(rx)

p = ps(x = p_int(-5, 5), y = p_dbl(-5, 5), z = p_dbl(-5, 5))
data = data.frame(x = 0:5, y = 0:5, z = 0:5)

rx$prime(p)
rx$operate(data)

rx$param_set$values$p = 0.3
rx$operate(data)

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