Open JedStephens opened 4 years ago
Any thoughts why when _ScalarObjective has the maximize = True the solve_pareto_front_representation function fails.
Hi Jed. I will look into this later today. I have my own suspicions why this problem is emerging.
@JedStephens I was able to reproduce the same results with both snippets of code you shared. The issue was that MOProblem expects its nadir and ideal points to be expressed as if each of the objectives were to be minimized. Also, when computing slices: https://github.com/industrial-optimization-group/desdeo-mcdm/blob/cda13019169f94fe50cc129635f1ac9164bf0ef5/desdeo_mcdm/utilities/solvers.py#L208 It was previously assumed that the values in the ideal point were always less than the values in nadir point. In other words, the assumption of everything being minimized was screwing things up.
Also, when defining an MOProblem
, the nadir and ideal should be supplied as if each of the objectives were to be minimized regardless of whether a _ScalarObjective
was to be actually minimized or maximized. So if you are maximizing each objective, you should have something like this:
# Notice the minus signs, we assume maximization in each objective here.
problem = MOProblem(variables=varsl, objectives=[f1, f2], ideal=-np.array([p_upper_bound, e_upper_bound]), nadir=-np.array([p_lower_bound, e_lower_bound]))
I think this is confusing and we should address this in the future.
solve_pareto_front_representation
should now return objective values with the correct sign when maximizing and objective. The latest version of desdeo-mcdm
on PyPI is up to date with the current master branch.
@gialmisi much appreciated as usual. Let me see how we go now for a bit!
@gialmisi Would you help me get to the right starting point for some of these problems.
When
_ScalarObjective
has themaximize = True
thesolve_pareto_front_representation
function fails.Code to reproduce:
The above process can be restated as a minimization problem. To do this I negate all the output values, change the upper and lower bounds and adjust the nadir and ideal values. (That's a lot to remember!) Now the code will run.
Code to reproduce