dict_mutators_erase | R Documentation |
"Mutates" individuals by forgetting the current value and sampling new individuals from scratch.
Since the information loss is very high, this should in most cases be combined with MutatorCmpMaybe
.
initializer
:: function
Function that generates the initial population as a Design
object,
with arguments param_set
and n
, functioning like paradox::generate_design_random
or paradox::generate_design_lhs
.
This is equivalent to the initializer
parameter of mies_init_population()
, see there for more information. Initialized to
generate_design_random()
.
Supported Domain
classes are: p_lgl
('ParamLgl'), p_int
('ParamInt'), p_dbl
('ParamDbl'), 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("erase") muts("erase") # takes vector IDs, returns list of Mutators # long form: dict_mutators$get("erase")
miesmuschel::MiesOperator
-> miesmuschel::Mutator
-> MutatorErase
new()
Initialize the MutatorErase
object.
MutatorErase$new()
clone()
The objects of this class are cloneable with this method.
MutatorErase$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other mutators:
Mutator
,
MutatorDiscrete
,
MutatorNumeric
,
OperatorCombination
,
dict_mutators_cmpmaybe
,
dict_mutators_gauss
,
dict_mutators_maybe
,
dict_mutators_null
,
dict_mutators_proxy
,
dict_mutators_sequential
,
dict_mutators_unif
set.seed(1)
mer = mut("erase")
p = ps(x = p_lgl(), y = p_fct(c("a", "b", "c")), z = p_dbl(0, 1))
data = data.frame(x = rep(TRUE, 5), y = rep("a", 5),
z = seq(0, 1, length.out = 5),
stringsAsFactors = FALSE) # necessary for R <= 3.6
mer$prime(p)
mer$operate(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.