p = ps(x = p_dbl(-5, 5))
data = data.frame(x = rep(0, 5))
sd = scl("domcount")
sd$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))
# note that for both 2 and 4, all points do not dominate them
# their value is therefore 1
sd$operate(data, fitnesses)
sd$param_set$values$scale_output = FALSE
sd$operate(data, fitnesses)
sd$param_set$values$output = "count_dominated"
# point 4 dominates three other points, point 2 only one other point.
sd$operate(data, fitnesses)
Run the code above in your browser using DataLab