dict_mutators_unif | R Documentation |
Discrete components are mutated by sampling from a uniform distribution, either from all possible values of each component, or from all values except the original value.
Since the information loss is very high, this should in most cases be combined with MutatorCmpMaybe
.
can_mutate_to_same
:: logical(1)
Whether to sample from entire range of each parameter (TRUE
) or from all values except the
current value (FALSE
). Initialized to TRUE
.
Supported Domain
classes are: p_lgl
('ParamLgl'), p_fct
('ParamFct')
This Mutator
can be created with the short access form mut()
(muts()
to get a list), or through the the dictionary
dict_mutators
in the following way:
# preferred: mut("unif") muts("unif") # takes vector IDs, returns list of Mutators # long form: dict_mutators$get("unif")
miesmuschel::MiesOperator
-> miesmuschel::Mutator
-> miesmuschel::MutatorDiscrete
-> MutatorDiscreteUniform
new()
Initialize the MutatorDiscreteUniform
object.
MutatorDiscreteUniform$new()
clone()
The objects of this class are cloneable with this method.
MutatorDiscreteUniform$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other mutators:
Mutator
,
MutatorDiscrete
,
MutatorNumeric
,
OperatorCombination
,
dict_mutators_cmpmaybe
,
dict_mutators_erase
,
dict_mutators_gauss
,
dict_mutators_maybe
,
dict_mutators_null
,
dict_mutators_proxy
,
dict_mutators_sequential
set.seed(1)
mdu = mut("unif")
p = ps(x = p_lgl(), y = p_fct(c("a", "b", "c")))
data = data.frame(x = rep(TRUE, 5), y = rep("a", 5),
stringsAsFactors = FALSE) # necessary for R <= 3.6
mdu$prime(p)
mdu$operate(data)
mdu$param_set$values$can_mutate_to_same = FALSE
mdu$operate(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.