org.decisiondeck.jmcda.services.outranking
Class Discordance

java.lang.Object
  extended by org.decisiondeck.jmcda.services.outranking.Discordance

public class Discordance
extends Object


Constructor Summary
Discordance()
           
 
Method Summary
 double discordancePairwize(double eval1, double eval2, Criterion criterion, Criterion.PreferenceDirection direction, double p, Double v)
          Evaluates the discordance between two alternatives having the given evaluations.
 Map<Criterion,IAltZeroToOneMatrix> discordances(IProblemData data, ICriteriaWithThresholds thresholds)
           Computes the discordance matrixes for each criterion in the given data.
 Double getSmallestSep()
          Retrieves the smallest difference, in absolute value, between any veto and any difference of performance used in the computation, if sharp vetoes are to be used.
 boolean isSharpVetoes()
           
 void setSharpVetoes(boolean sharpVetoes)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Discordance

public Discordance()
Method Detail

discordances

public Map<Criterion,IAltZeroToOneMatrix> discordances(IProblemData data,
                                                       ICriteriaWithThresholds thresholds)
                                                throws InvalidInputException

Computes the discordance matrixes for each criterion in the given data.

For the input to be valid, all evaluations must be given, all preference directions must be defined, the set of criteria on which thresholds are given must be a subset of the set of criteria in the problem data, the veto thresholds must be strictly greater than the preference threshold for each criteria. Otherwise, an InvalidInputException is thrown.

Parameters:
data - not null.
thresholds - not null, only the preferences and vetoes thresholds are used, some may be missing. If this object uses sharp vetoes, only the vetoes are used.
Returns:
not null, one entry per criteria, no null value.
Throws:
InvalidInputException - if the input is not valid.

discordancePairwize

public double discordancePairwize(double eval1,
                                  double eval2,
                                  Criterion criterion,
                                  Criterion.PreferenceDirection direction,
                                  double p,
                                  Double v)
                           throws InvalidInputException
Evaluates the discordance between two alternatives having the given evaluations.

Parameters:
eval1 - the evaluation of the first alternative from the point of view of the considered criterion.
eval2 - the evaluation of the second alternative from the point of view of the considered criterion.
criterion - only used for the error message string in case of exception, may be null.
direction - not null.
p - the preference threshold of the considered criterion.
v - the veto threshold of the considered criterion. Must be greater than the preference threshold. If null, the returned discordance is necessarily zero.
Returns:
the discordance of the given criterion over the fact that the first alternative (having the first evaluation) would be preferred to the second one (with the second evaluation).
Throws:
InvalidInputException - if the veto threshold is lower than or equal to the preference threshold.

isSharpVetoes

public boolean isSharpVetoes()

setSharpVetoes

public void setSharpVetoes(boolean sharpVetoes)

getSmallestSep

public Double getSmallestSep()
Retrieves the smallest difference, in absolute value, between any veto and any difference of performance used in the computation, if sharp vetoes are to be used. Useful for sensitivity analysis or to check for possible numerical errors. The number is positive or nul. It represents the largest quantity that may be added or substracted from all the veto thresholds without changing the discordance relation.

Returns:
null if no computation have been preformed or no values were found when asked for a computation or sharp vetoes are not used.


Copyright © 2011. All Rights Reserved.