| dict_recombinators_proxy {miesmuschel} | R Documentation | 
Proxy-Recombinator that Recombines According to its Configuration parameter
Description
Recombinator that performs the operation in its operation configuration parameter. This is useful, e.g., to make
OptimizerMies's recombination operation fully parametrizable.
Configuration Parameters
-  
operation::Recombinator
Operation to perform. Must be set by the user. This is primed when$prime()ofRecombinatorProxyis 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 multipleRecombinatorProxyobjects, then it is recommended to$clone(deep = TRUE)the object before assigning them tooperationto 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 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("proxy")
recs("proxy")  # takes vector IDs, returns list of Recombinators
# long form:
dict_recombinators$get("proxy")
Super classes
miesmuschel::MiesOperator -> miesmuschel::Recombinator -> RecombinatorProxy
Methods
Public methods
Inherited methods
Method new()
Initialize the RecombinatorProxy object.
Usage
RecombinatorProxy$new(n_indivs_in = 2, n_indivs_out = n_indivs_in)
Arguments
n_indivs_in(
integer(1))
Number of individuals to consider at the same time. When operating, the number of input individuals must be divisible by this number. Furthermore, theRecombinatorassigned to theoperationconfiguration parameter must have ann_indivs_inthat is a divisor of this number. Default 2.
The$n_indivs_infield will reflect this value.n_indivs_out(
integer(1))
Number of individuals that result for eachn_indivs_inlines of input. Must be at mostn_indivs_in. The ratio of$n_indivs_into$n_indivs_outof theRecombinatorassigned to theoperationconfiguration parameter must be the same asn_indivs_inton_indivs_outof this object. Default equal ton_indivs_in.
The$n_indivs_outfield will reflect this value.
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
RecombinatorProxy$prime(param_set)
Arguments
param_set(
ParamSet)
Passed toMiesOperator$prime().
Returns
invisible self.
Method clone()
The objects of this class are cloneable with this method.
Usage
RecombinatorProxy$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
See Also
Other recombinators: 
OperatorCombination,
Recombinator,
RecombinatorPair,
dict_recombinators_cmpmaybe,
dict_recombinators_convex,
dict_recombinators_cvxpair,
dict_recombinators_maybe,
dict_recombinators_null,
dict_recombinators_sbx,
dict_recombinators_sequential,
dict_recombinators_swap,
dict_recombinators_xonary,
dict_recombinators_xounif
Other recombinator wrappers: 
OperatorCombination,
dict_recombinators_cmpmaybe,
dict_recombinators_maybe,
dict_recombinators_sequential
Examples
set.seed(1)
rp = rec("proxy", operation = rec("xounif"))
p = ps(x = p_int(-5, 5), y = p_dbl(-5, 5), z = p_lgl())
data = data.frame(x = 1:4, y = 0:3, z = rep(TRUE, 4))
rp$prime(p)
rp$operate(data)  # default operation: null
rp$param_set$values$operation = rec("xounif", p = 0.5)
rp$operate(data)