Scalor
that returns a the fitness value of a single objective dimension as scale.
objective
:: integer(1)
objective to return as scale, ranges from 1 (the default, first objective) to the number of objectives
of the function being optimized.
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:
miesmuschel::MiesOperator
-> miesmuschel::Scalor
-> ScalorOne
so = scl("one")
p = ps(x = p_dbl(-5, 5))
# dummy data; note that ScalorOne does not depend on data content
data = data.frame(x = rep(0, 5))
fitnesses = matrix(c(1, 5, 2, 3, 0, 3, 1, 0, 10, 8), ncol = 2)
so$prime(p)
so$operate(data, fitnesses)
#> [1] 1 5 2 3 0
so$param_set$values$objective = 2
so$operate(data, fitnesses)
#> [1] 3 1 0 10 8