org.decisiondeck.xmcda_oo.services.sorting
Class ProfilesDistance
java.lang.Object
org.decisiondeck.xmcda_oo.services.sorting.ProfilesDistance
public class ProfilesDistance
- extends Object
This object also accepts values outside of the relevant scale's boundaries.
|
Method Summary |
void |
computeDistances(IRdEvaluations profilesEvaluations1,
IRdEvaluations profilesEvaluations2,
Map<Criterion,IntegerStepScaleToDel> scales,
SortingMode sortingMode)
|
double |
getDistance(double value1,
double value2,
IntegerStepScaleToDel scale,
SortingMode sortingMode)
|
int |
getDistanceInAlternatives(IRdEvaluations profilesEvaluations1,
IRdEvaluations profilesEvaluations2,
IRdEvaluations alternatives)
|
int |
getLastDistanceInAlternatives()
|
double |
getLastMaxDist()
|
double |
getLastSumDist()
|
double |
getMaxDistance(IRdEvaluations profilesEvaluations1,
IRdEvaluations profilesEvaluations2,
Map<Criterion,IntegerStepScaleToDel> scales,
SortingMode sortingMode)
|
int |
getNbEquals()
TODO remove method duplication with ProfilesDistanceResult. |
int |
getNbEquals(double approx)
|
NavigableMap<Double,Integer> |
getNbEqualsByApprox()
|
ProfilesDistanceResult |
getResults()
|
double |
getSumDistance(IRdEvaluations profilesEvaluations1,
IRdEvaluations profilesEvaluations2,
Map<Criterion,IntegerStepScaleToDel> scales,
SortingMode sortingMode)
|
void |
resetComputations()
|
void |
setComputeApproximations(Set<Double> approximationLevels)
|
ProfilesDistance
public ProfilesDistance()
getResults
public ProfilesDistanceResult getResults()
getDistance
public double getDistance(double value1,
double value2,
IntegerStepScaleToDel scale,
SortingMode sortingMode)
getSumDistance
public double getSumDistance(IRdEvaluations profilesEvaluations1,
IRdEvaluations profilesEvaluations2,
Map<Criterion,IntegerStepScaleToDel> scales,
SortingMode sortingMode)
- Parameters:
profilesEvaluations1 - must contain the same profiles on the same criteria evaluations as the other profiles, and be
complete.profilesEvaluations2 - see above.scales - must have scales assigned to a set of criteria corresponding to the given profiles evaluations.sortingMode - the sorting mode used, used to standardize the profiles.
- Returns:
- the sum of the distances on each criteria and profile pair.
computeDistances
public void computeDistances(IRdEvaluations profilesEvaluations1,
IRdEvaluations profilesEvaluations2,
Map<Criterion,IntegerStepScaleToDel> scales,
SortingMode sortingMode)
getDistanceInAlternatives
public int getDistanceInAlternatives(IRdEvaluations profilesEvaluations1,
IRdEvaluations profilesEvaluations2,
IRdEvaluations alternatives)
- Parameters:
profilesEvaluations1 - a set of profiles.profilesEvaluations2 - an other set of profiles.alternatives - must be evaluated on the same criteria.
- Returns:
- the total number of evaluations of alternatives that are in between (not strict) both profiles
evaluations.
setComputeApproximations
public void setComputeApproximations(Set<Double> approximationLevels)
getMaxDistance
public double getMaxDistance(IRdEvaluations profilesEvaluations1,
IRdEvaluations profilesEvaluations2,
Map<Criterion,IntegerStepScaleToDel> scales,
SortingMode sortingMode)
- Parameters:
profilesEvaluations1 - must contain the same profiles on the same criteria evaluations as the other profiles, and be
complete.profilesEvaluations2 - see above.scales - must have scales assigned to a set of criteria corresponding to the given profiles evaluations.sortingMode - the sorting mode used, used to standardize the profiles.
- Returns:
- the maximum distance found among all criteria and profiles pair comparison.
getLastMaxDist
public double getLastMaxDist()
- Returns:
- -1 if not yet computed or given data was empty (no distance found).
getLastSumDist
public double getLastSumDist()
- Returns:
- -1 if not yet computed.
getNbEquals
public int getNbEquals()
- TODO remove method duplication with
ProfilesDistanceResult.
- Returns:
- the number of equals with an approximation of zero.
getNbEquals
public int getNbEquals(double approx)
getNbEqualsByApprox
public NavigableMap<Double,Integer> getNbEqualsByApprox()
- Returns:
- a copy of the current results. Will contain values of -1 iff not yet computed, otherwise, only positive
or null values.
getLastDistanceInAlternatives
public int getLastDistanceInAlternatives()
resetComputations
public void resetComputations()
Copyright © 2011. All Rights Reserved.