# fitnesses: three rows (i.e. thee indivs) with two objective values each
fitnesses <- matrix(0:5, ncol = 2)
# weights: contains one matrix for each row of 'fitnesses' (i.e. each indiv)
# which get multiplied with their respective row.
weights <- list(
matrix(c(1, 0, 0, 1), ncol = 2),
matrix(c(1, 2, 0, 0), ncol = 2),
matrix(c(0, 1, 0, 1), ncol = 2)
)
sc <- scalarizer_linear()
# The resulting row-vectors are the different scalarizations according to the
# columns in the 'weights' matrices.
sc(fitnesses, weights)
Run the code above in your browser using DataLab