org.decisiondeck.jmcda.services.outranking
Class Concordance

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

public class Concordance
extends Object

A concordance utility allowing to compute electre-style concordance indices and promethee-style preference indices. TODO generalize to accept preference and indifference threshold functions, not only values (function of the evaluation).


Constructor Summary
Concordance()
           
 
Method Summary
 IAltZeroToOneMatrix concordance(IProblemData data, ICriteriaWithThresholds thresholds, Weights weights)
           Computes a matrix containing the concordance indices for all the alternatives in the given data.
 double concordancePairwize(double evalAlt1, double evalAlt2, Criterion.PreferenceDirection direction, double p, double q)
          Computes the concordance index between two alternatives on a given criterion, i.e. the degree to which the first alternative is preferred (à la Electre) to the second, on a zero to one scale, from the point of view of the given criterion (and not considering discordance and vetoes).
 Map<Criterion,IAltZeroToOneMatrix> concordances(IProblemData data, ICriteriaWithThresholds thresholds)
           
static Map<Criterion,IAltZeroToOneMatrix> concordances(ISortingPreferences sortingProblem)
           
 IAltZeroToOneMatrix preference(IProblemData data, ICriteriaWithThresholds thresholds, Weights weights)
           Computes a matrix containing the preference indices, a la Promethee, for all the alternatives in the given data.
 double preferencePairwize(double evalAlt1, double evalAlt2, Criterion.PreferenceDirection direction, double p, double q)
           
 void setTargetColumns(Set<Alternative> columns)
          Restricts the columns of the matrixes this object returns to those given.
 void setTargetRows(Set<Alternative> rows)
          Restricts the rows of the matrixes this object returns to those given.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Concordance

public Concordance()
Method Detail

preference

public IAltZeroToOneMatrix preference(IProblemData data,
                                      ICriteriaWithThresholds thresholds,
                                      Weights weights)
                               throws InvalidInputException

Computes a matrix containing the preference indices, a la Promethee, for all the alternatives in the given data. The returned matrix is complete.

For the input to be valid, all weights must be provided, all criteria must have preference directions, all evaluations must be provided, the set of criteria on which thresholds are defined must be in the set of criteria, the preference threshold must be greater or equal to the indifference threshold for each criteria. Otherwise, an InvalidInputException is thrown. The scales are not used apart from the preference direction information.

Parameters:
data - not null.
thresholds - not null. Missing thresholds are considered zero. Vetoes are not used.
weights - must contain a weight for each of the criteria to consider. Not null. Do not have to be normalized.
Returns:
not null.
Throws:
InvalidInputException - if the input is not valid.

concordancePairwize

public double concordancePairwize(double evalAlt1,
                                  double evalAlt2,
                                  Criterion.PreferenceDirection direction,
                                  double p,
                                  double q)
                           throws InvalidInputException
Computes the concordance index between two alternatives on a given criterion, i.e. the degree to which the first alternative is preferred (à la Electre) to the second, on a zero to one scale, from the point of view of the given criterion (and not considering discordance and vetoes).

Parameters:
evalAlt1 - evaluation of the first alternative.
evalAlt2 - evaluation of the second alternative.
direction - not null.
p - the preference threshold.
q - the indifference threshold.
Returns:
a number between zero and one.
Throws:
InvalidInputException - if the preference threshold is strictly smaller than the indifference threshold.

preferencePairwize

public double preferencePairwize(double evalAlt1,
                                 double evalAlt2,
                                 Criterion.PreferenceDirection direction,
                                 double p,
                                 double q)
                          throws InvalidInputException
Throws:
InvalidInputException

concordances

public Map<Criterion,IAltZeroToOneMatrix> concordances(IProblemData data,
                                                       ICriteriaWithThresholds thresholds)
                                                throws InvalidInputException
Throws:
InvalidInputException

setTargetRows

public void setTargetRows(Set<Alternative> rows)
Restricts the rows of the matrixes this object returns to those given. This must be a subset of the rows normally returned. This call only affects computations asked for after this method has been called, already computed objects are not affected.

Parameters:
rows - null for no restriction.

setTargetColumns

public void setTargetColumns(Set<Alternative> columns)
Restricts the columns of the matrixes this object returns to those given. This must be a subset of the rows normally returned. This call only affects computations asked for after this method has been called, already computed objects are not affected.

Parameters:
columns - null for no restriction.

concordance

public IAltZeroToOneMatrix concordance(IProblemData data,
                                       ICriteriaWithThresholds thresholds,
                                       Weights weights)
                                throws InvalidInputException

Computes a matrix containing the concordance indices for all the alternatives in the given data. The returned matrix is complete.

For the input to be valid, all weights must be provided, all criteria must have preference directions, all evaluations must be provided, the set of criteria on which thresholds are defined must be in the set of criteria, the preference threshold must be greater or equal to the indifference threshold for each criteria. Otherwise, an InvalidInputException is thrown. The scales are not used apart from the preference direction information.

Parameters:
data - not null.
thresholds - not null. Missing thresholds are considered zero. Vetoes are not used.
weights - must contain a weight for each of the criteria to consider. Not null. Do not have to be normalized.
Returns:
not null.
Throws:
InvalidInputException - if the input is not valid.

concordances

public static Map<Criterion,IAltZeroToOneMatrix> concordances(ISortingPreferences sortingProblem)
                                                       throws InvalidInputException
Throws:
InvalidInputException


Copyright © 2011. All Rights Reserved.