if (FALSE) {
# Creamos un "dummy" objeto mínimo
object <- list(
population = matrix(runif(20), nrow=5),
fitness = matrix(runif(10), nrow=5),
front = matrix(sample(1:2, 5, TRUE), ncol=1),
crowdingDistance = runif(5),
popSize = 5
)
class(object) <- "nsga2"
# Llamamos al selector
sel <- rmoo_tourSelection(object, k = 2)
str(sel)
}
Run the code above in your browser using DataLab