Null-recombinator that does not perform any operation on its input. Useful in particular with operator-wrappers such as RecombinatorMaybe or RecombinatorCombination.

n_indivs_in and n_indivs_out can be set during construction, where n_indivs_out must be less or equal n_indivs_in. If it is strictly less, then the operation returns only the first n_indivs_out individuals out of each n_indivs_in sized group.

Configuration Parameters

This operator has no configuration parameters.

Supported Operand Types

Supported Param classes are: ParamLgl, ParamInt, ParamDbl, 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("null")
recs("null")  # takes vector IDs, returns list of Recombinators

# long form:
dict_recombinators$get("null")

Super classes

miesmuschel::MiesOperator -> miesmuschel::Recombinator -> RecombinatorNull

Methods

Inherited methods


Method new()

Initialize base class components of the Recombinator.

Usage

RecombinatorNull$new(n_indivs_in = 1, 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. Setting this number to a number unequal 1 is mostly useful when incorporating this operator in wrappers such as RecombinatorMaybe or RecombinatorCombination. Default 1.
The $n_indivs_in field will reflect this value.

n_indivs_out

(integer(1))
Number of individuals that result for each n_indivs_in lines of input. Must be at most n_indivs_in. If this is less than n_indivs_in, then only the first n_indivs_out individuals out of each n_indivs_in sized group are returned by an operation. Setting this number to a number unequal 1 is mostly useful when incorporating this operator in wrappers such as RecombinatorMaybe or RecombinatorCombination. Default equal to n_indivs_in.
The $n_indivs_out field will reflect this value.


Method clone()

The objects of this class are cloneable with this method.

Usage

RecombinatorNull$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

rn = rec("null")
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))

rn$prime(p)
rn$operate(data)
#>   x y    z
#> 1 1 0 TRUE
#> 2 2 1 TRUE
#> 3 3 2 TRUE
#> 4 4 3 TRUE

rn_half = rec("null", n_indivs_in = 2, n_indivs_out = 1)
rn_half$prime(p)
rn_half$operate(data)
#>   x y    z
#> 1 1 0 TRUE
#> 2 3 2 TRUE