dict_scalors_aggregate {miesmuschel}R Documentation

Scalor giving Weighted Sum of Multiple Scalors

Description

Scalor that applies multiple other Scalors and calculates their weighted sum.

Configuration Parameters

This operation has the configuration parameters of the Scalors that it wraps: The configuration parameters of the operator given to the scalors construction argument are prefixed with "scalor_1", "scalor_2", ... up to "scalor_#", where ⁠#⁠ is length(scalors).

Additional configuration parameters:

Dictionary

This Scalor can be created with the short access form scl() (scls() to get a list), or through the the dictionary dict_scalors in the following way:

# preferred:
scl("aggregate", <scalors>)
scls("aggregate", <scalors>)  # takes vector IDs, returns list of Scalors

# long form:
dict_scalors$get("aggregate", <scalors>)

Super classes

miesmuschel::MiesOperator -> miesmuschel::Scalor -> ScalorAggregate

Active bindings

scalors

(list of Scalor)
Scalors being wrapped. These operators are run and their outputs weighted.

Methods

Public methods

Inherited methods

Method new()

Initialize the ScalorAggregate object.

Usage
ScalorAggregate$new(scalors)
Arguments
scalors

(list of Scalor)
Scalors to wrap. The operations are run and weighted by weight_# configuration parameters, depending on the scaling configuration parameter. The constructed object gets a clone of this argument. The ⁠$scalors⁠ field will reflect this value.


Method prime()

See MiesOperator method. Primes both this operator, as well as the wrapped operators given to scalors during construction.

Usage
ScalorAggregate$prime(param_set)
Arguments
param_set

(ParamSet)
Passed to MiesOperator⁠$prime()⁠.

Returns

invisible self.


Method clone()

The objects of this class are cloneable with this method.

Usage
ScalorAggregate$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other scalors: Scalor, dict_scalors_domcount, dict_scalors_fixedprojection, dict_scalors_hypervolume, dict_scalors_nondom, dict_scalors_one, dict_scalors_proxy, dict_scalors_single

Other scalor wrappers: dict_scalors_fixedprojection, dict_scalors_proxy

Examples

p = ps(x = p_dbl(-5, 5))
data = data.frame(x = rep(0, 5))

sa = scl("aggregate", list(
    scl("one", objective = 1),
    scl("one", objective = 2)
))
sa$prime(p)

(fitnesses = matrix(c(1, 5, 2, 3, 0, 3, 1, 0, 10, 8), ncol = 2))

# to see the fitness matrix, use:
## plot(fitnesses, pch = as.character(1:5))

# default weight 1 -- sum of both objectives
sa$operate(data, fitnesses)

# only first objective
sa$param_set$values[c("weight_1", "weight_2")] = c(1, 0)
sa$operate(data, fitnesses)

# only 2 * second objective
sa$param_set$values[c("weight_1", "weight_2")] = c(0, 2)
sa$operate(data, fitnesses)

[Package miesmuschel version 0.0.4 Index]