"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.

Configuration Parameters

Supported Operand Types

Supported Param classes are: ParamLgl, ParamInt, ParamDbl, ParamFct

Dictionary

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")

Super classes

miesmuschel::MiesOperator -> miesmuschel::Mutator -> MutatorErase

Methods

Inherited methods


Method new()

Initialize the MutatorErase object.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

MutatorErase$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

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)
#>       x y         z
#> 1  TRUE c 0.2059746
#> 2  TRUE c 0.1765568
#> 3 FALSE b 0.6870228
#> 4 FALSE b 0.3841037
#> 5  TRUE a 0.7698414