Replies: 1 comment 17 replies
-
You are trying to solve a subset selection problem. That means that you are looking for k indices from N. As such, your decision vector Sampling: randomly choose k from N. I also want to point out that your evaluate method should be a bit different: def _evaluate(self, x, out, *args, **kwargs):
out["F"] = np.array([self.metrics["rank"][x], self.metrics["mpg"][x]], dtype=float) where metrics is the full list from which you want to pick your subset |
Beta Was this translation helpful? Give feedback.
-
I am trying to follow this [method (https://pymoo.org/customization/custom.html) to solve an optimization problem. I have a bag of N=100 vehicles which have certain properties. For example cost, rank, and mpg. I am looking to find k=5 subsets of vehicles that have higher mpg and rank than others. N and k can take any values.
Following the (pymoo)[https://pymoo.org/customization/custom.html], the evaluation function looks like this:
Here, x has as many dimensions as many columns for vehicles. In this case, I am using rank and mpg as I want to maximize these.
The guide says to create methods including:
Sampling Crossover Mutation
I want to know how can I formulate the above problem in these functions.
Sampling: refer the link above, should I create a method that takes 5 random vehicles from bag and return these?
Crossover: I am blind to this. What should I be doing in my case?
Mutation: I don't know what to implement here.
If somebody has used pymoo, give me some hints on the above so that I can do my implementation.
Many Thanks
Beta Was this translation helpful? Give feedback.
All reactions