Solution comparators
Closed this issue · 0 comments
StuartGordonReid commented
Currently I'm checking if a problem is a min or a max and then evaluating two or more solutions side by side to decide which is better ... I should instead,
- Overload the >, <, =, >=, <=, and != operators for the Solution abstract base class
- Decouple the Function (optimization problem) from the Optimizer
- Couple the Solution abc with the Function
That way in the Optimizer you would be able to directly compare solutions (or an instantiation thereof e.g. Particle) using equalities which will be a lot neater.