dict_recombinators_cvxpair | R Documentation |
Numeric Values between various individuals are recombined via component-wise convex combination (or weighted mean). Exactly two
individuals are being recombined, and the lambda
configuration parameter determines the relative weight of the first
individual in each pair for the first result, and the relative weight of the second indivudual for the complement, if
initialized with keep_complement
set to TRUE
.
lambda
:: numeric
Combination weight. If keep_complement
is TRUE
, then two individuals are returned for each pair of input individuals:
one corresponding to lambda * <1st individual> + (1-lambda) * <2nd individual>
, and one corresponding to
(1-lambda) * <1st individual> + lambda * <2nd individual>
(i.e. the complement). Otherwise, only the first of these two
is generated.
Must either be a scalar, or a vector with length equal to the number of
components in the values being operated on. Must be between 0 and 1.
Initialized to 0.5.
Supported Domain
classes are: p_dbl
('ParamDbl')
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("convex") recs("convex") # takes vector IDs, returns list of Recombinators # long form: dict_recombinators$get("convex")
miesmuschel::MiesOperator
-> miesmuschel::Recombinator
-> miesmuschel::RecombinatorPair
-> RecombinatorConvexPair
new()
Initialize the RecombinatorConvexPair
object.
RecombinatorConvexPair$new(keep_complement = TRUE)
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.
clone()
The objects of this class are cloneable with this method.
RecombinatorConvexPair$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other recombinators:
OperatorCombination
,
Recombinator
,
RecombinatorPair
,
dict_recombinators_cmpmaybe
,
dict_recombinators_convex
,
dict_recombinators_maybe
,
dict_recombinators_null
,
dict_recombinators_proxy
,
dict_recombinators_sbx
,
dict_recombinators_sequential
,
dict_recombinators_swap
,
dict_recombinators_xonary
,
dict_recombinators_xounif
set.seed(1)
rcvx = rec("cvxpair")
p = ps(x = p_dbl(-5, 5), y = p_dbl(-5, 5), z = p_dbl(-5, 5))
data = data.frame(x = 0:5, y = 0:5, z = 0:5)
rcvx$prime(p)
rcvx$operate(data) # mean of groups of 2
# with the default value of lambda = 0.5, the default of
# keep_complement = TRUE means that pairs of equal values are generated;
# consider setting keep_complement = FALSE int that case.
rcvx$param_set$values$lambda = 0.1
rcvx$operate(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.