Closed oliviercailloux closed 6 years ago
Did I miss something to do here? I did'nt modified the value of epsilon because I use the method given by Labreuche in his paper.
displayAsVector
and showVector
do almost the same thing; showGraph
is probably not useful); move general utilities (not Labreuche-related) to a more general Utils
class (for example showVector
).showVector
only uses the values of the map so the method doesn’t need a map as input, and by the way, it should use a number formatter internally)List
of criteria (instead of Set
) really needed? If not, remove all those methods to simplify code.showProblem()
does not really seem to belong to AlternativesComparison
, as it is currently defined.LabreucheModel
should have at least one method whose name clearly indicates that it computes the solution. This method should probably be decomposed into several methods to avoid very long methods. Currently isApplicable
does the job but its name does not indicate it; and it is much too long.getSomethingExplanation
, must preconditions as soon as possible, not at the end of the method (it’s a general rule to be applied everywhere possible). It should be visible where it computes, if it does (cf. previous point).argue
logic out of Model, as discussedExcellent improvement!
Small details:
alternativesComparison.getDelta().values()
is enough.compute
, assert that labreucheOutput
is not null
(to make clear and make sure that null
is never returned).isApplicable
, return labreucheOutput.getAnchor() == anchor
.getCheckedExplanation
, not getCheckExplanation
.Replace more “couple” by graphs where it’s easy: couples_of
, tryIVT
.
Small details fixed and List<Couple<Criterion,Criterion> turned into Graph
Very good job about Graphs. Still a few (very small) details:
assert labreucheOutput != null;
instead of assert !(labreucheOutput == null);
computeExplanation()
is incorrectly formatted.I believe the test in includeDiscri
if (d_eu(a.get(k), w, delta) == d_eu(b.get(k), w, delta))
can never be true
. (How come the code works?!)
You can probably simplify d_eu
as you seem to only use the “left” value (except in the place above, is it important?).
Small details fixed.
Indeed, in includeDisicri it can be true only if the Couples returned are the same. SImply need to add .getLeft(). Fortunately it was never trigerred this condition in the examples.
for d_eu : in tryIVT I use getRight() on the Couple returned in order to avoid computing the minimal permutation again.
Very good improvement overall. I’ll open more issues for the remaining points.
isApplicable(Anchor)
orgetSomethingExplanation()
, should compute only once. Document (private javadoc) that the variable is null iff it has not been initialized.phiALL
and other output variables, use onlylabreucheOutput
and cast as necessary.AlternativesComparison
instead inLabreucheModel()
, remove redundant three variables.isSomethingApplicable()
showProblem()
if you want to show the problem (instead ofstartproblem
), and are located in appropriate class (for exampleshowProblem()
could be inAlternativesComparison
I suppose)getWeight()
,getX()
,getY()
bygetAlternativesComparison()
(simplifies interface).