org.decisiondeck.jmcda.services.sorting.assignments
Class EmbeddedCredibilitiesExtractor

java.lang.Object
  extended by org.decisiondeck.jmcda.services.sorting.assignments.EmbeddedCredibilitiesExtractor

public class EmbeddedCredibilitiesExtractor
extends Object


Field Summary
static double DEFAULT_TOLERANCE
           
 
Constructor Summary
EmbeddedCredibilitiesExtractor(IOrderedAssignmentsWithCredibilitiesRead assignments)
           
 
Method Summary
 NavigableMap<Double,Set<IOrderedAssignmentsWithCredibilitiesRead>> getByCredibilityLevel()
           The bound assignments must have at least one assigned alternative.
 Set<IOrderedAssignmentsWithCredibilitiesRead> getProductSetOfIntervals(double minimalCredibility)
           Retrieves the product set of all possible “smallest” intervals of the bound assignments.
static Set<IOrderedAssignmentsWithCredibilitiesRead> getProductSetOfIntervals(IOrderedAssignmentsWithCredibilitiesRead assignments, double minimalCredibility)
           
static Iterator<IOrderedAssignmentsWithCredibilitiesRead> getProductSetOfIntervalsIterator(SortedSet<Category> categories, Map<Alternative,Set<SortedMap<Category,Double>>> allIntervals)
          Retrieves an iterator that will give every assignments that can possibly be built using, for each alternative, one of the intervals given as possible for this alternative.
static double getSmallestEdge(Set<IOrderedAssignmentsWithCredibilitiesRead> assignmentsSet)
          Retrieves the smallest credibility level found in an edge of the credibilities among all assignments.
static Set<SortedMap<Category,Double>> getSmallestMostCredibleIntervals(SortedMap<Category,Double> credibilities, double minimalCredibility)
           Retrieves the “smallest” intervals, i.e., the intervals containing the least possible number of categories, whose sum of credibilities is greater than or equal to the given minimal credibility level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TOLERANCE

public static final double DEFAULT_TOLERANCE
See Also:
Constant Field Values
Constructor Detail

EmbeddedCredibilitiesExtractor

public EmbeddedCredibilitiesExtractor(IOrderedAssignmentsWithCredibilitiesRead assignments)
Method Detail

getSmallestMostCredibleIntervals

public static Set<SortedMap<Category,Double>> getSmallestMostCredibleIntervals(SortedMap<Category,Double> credibilities,
                                                                               double minimalCredibility)

Retrieves the “smallest” intervals, i.e., the intervals containing the least possible number of categories, whose sum of credibilities is greater than or equal to the given minimal credibility level. If several intervals are possible, only the most credible intervals, i.e., those whose sum of creadibilities is the highest, are returned. Ex-æquos are still possible, thus more than one such interval may be returned.

Example: suppose the given credibilities are, in order: 3, 4, 1, and a minimal credibility of 5 is asked. Two smallest intervals are possible: [c1, c2] and [c2, c3]. Of those, the first one is more credible and is returned in a singleton set. [c1, c2, c3] is not returned because it contains three categories and is thus not among the smallest ones. Now suppose the credibilities are 2, 4, 2. Then two smallest intervals have a minimal credibility of 5: [c1, c2] and [c2, c3]. As they have the same credibility, they will both be returned. If the credibilities are 3, 1, 2, the set of categories c1 and c3 would reach the required credibility but this is not an interval, thus the returned interval will be [c1, c2, c3]. Finally, suppose the credibilities are 2, 2, 0, 3. The smallest interval of credibility at least 4 is [c1, c2].

To account for numerical imprecision, two intervals having the same credibility ± DEFAULT_TOLERANCE will be considered as having the same credibility. However the minimal credibility is considered strict.

Parameters:
credibilities - not null, not empty. The values must be positive or zero.
minimalCredibility - a positive, not null, number. Must be less than or equal to the sum of the given credibilities, otherwise no intervals would be valid.
Returns:
not null, not empty.

getProductSetOfIntervals

public static Set<IOrderedAssignmentsWithCredibilitiesRead> getProductSetOfIntervals(IOrderedAssignmentsWithCredibilitiesRead assignments,
                                                                                     double minimalCredibility)

getProductSetOfIntervalsIterator

public static Iterator<IOrderedAssignmentsWithCredibilitiesRead> getProductSetOfIntervalsIterator(SortedSet<Category> categories,
                                                                                                  Map<Alternative,Set<SortedMap<Category,Double>>> allIntervals)
Retrieves an iterator that will give every assignments that can possibly be built using, for each alternative, one of the intervals given as possible for this alternative. The resulting iterator has a number of different entries that is the product of the number of all sets of possible intervals over all alternatives.

Parameters:
categories - not null; is required in order to determine the total ordering of the categories. Must be a superset of all categories used in the intervals. Will be used as the categories associated to all the returned assignments objects in the returned set.
allIntervals - not null; may be empty. Contains the set, for each alternative, of all possible intervals the alternative may be assigned to. The sets must be non null and non empty.
Returns:
not null; empty iff no alternatives have been given, i.e. the given map is empty.

getByCredibilityLevel

public NavigableMap<Double,Set<IOrderedAssignmentsWithCredibilitiesRead>> getByCredibilityLevel()

The bound assignments must have at least one assigned alternative. To account for possible numerical imprecision, the minimal difference between any two credibility values must be 10 times greater than the DEFAULT_TOLERANCE, or all values must be equal (only one value used).

This method computes a set of new assignments objects from the assignments bound to this object. The new assignments are ordered by credibility level. The set of assignments objects corresponding to a given credibility level is the set of assignments objects that can be reached by taking the product set of the “smallest” intervals reaching at least that credibility: see getProductSetOfIntervals(org.decisiondeck.jmcda.structure.sorting.assignment.credibilities.IOrderedAssignmentsWithCredibilitiesRead, double). The lowest credibility level in the returned map is greater than or equal to the lowest credibility value in the input assignments: it is the lowest credibility value such that every alternative in the bound assignments have at least one category associated to at least that value.

The rationale is that at a given credibility level, we consider the assignment information as precise as possible, thus as constraining as possible, thus with categories as narrow as possible, while consisting only of information reaching at least the considered level of credibility.

The assignments corresponding to a credibility level l are not necessarily narrower than the assignments corresponding to a higher credibility level l'. Consider an alternative having credibilities of assignment (in order of the categories) 2, 2, 0, 3, and consider the relevant intervals reaching at least a credibility level of 4. There is no such interval of size one, and the interval counting two categories having the highest credibility and reaching at least a credibility of 4 is the interval [c1, c2]. Now consider the intervals reaching a credibility of 3. The relevant smallest interval is [c4], which is not included in the former one.

Returns:
not null, not empty.

getSmallestEdge

public static double getSmallestEdge(Set<IOrderedAssignmentsWithCredibilitiesRead> assignmentsSet)
Retrieves the smallest credibility level found in an edge of the credibilities among all assignments. For example, if an assignment has credibilities (in order of the categories) 5, 3, 1, then the considered numbers are 5 and 1, and the returned number (supposing no smaller credibility level is found in other entries) would be 1.

Parameters:
assignmentsSet - not null, not empty, at least one entry containing at least one alternative.
Returns:
a number greater than zero.

getProductSetOfIntervals

public Set<IOrderedAssignmentsWithCredibilitiesRead> getProductSetOfIntervals(double minimalCredibility)

Retrieves the product set of all possible “smallest” intervals of the bound assignments.

First, computes the “smallest” intervals of the bound assignments, i.e., the intervals containing the least possible number of categories, whose sum of credibilities is greater than or equal to the given minimal credibility level. If several intervals are possible, only the most credible intervals, i.e., those whose sum of creadibilities is the highest, are returned. Ex-æquos are still possible, thus more than one such interval may be returned.

Then, computes the product set of all these intervals.

For example, consider an assignments object of two alternatives into three categories, with a1 having credibilities 3, 4, 1 and a2 having credibilities 2, 4, 2. Suppose the requested minimal credibility is 5. Then this method returns two assignment objects. In each of them a1 is assigned into the only possible smallest interval, that is the first two categories with credibilities 3 and 4. That is because two categories is the smallest number of categories required to reach a credibility level of 5, and this combination is the highest credibility with two categories. Regarding a2, in one of the returned assignments objects, a2 is assigned to c1 and c2 (with credibilities 2 and 4); in the other one a2 is assigned to c2 and c3 (with credibilities 4 and 2).

To account for numerical imprecision, two intervals having the same credibility ± DEFAULT_TOLERANCE will be considered as having the same credibility. However the minimal credibility is considered strict.

Parameters:
minimalCredibility - a number greater than zero. Must be less than or equal to the smallest sum of credibilities found in the bound assignments, otherwize it is impossible to find adequate intervals.
Returns:
not null, empty iff no alternatives are assigned in the input assignments.


Copyright © 2011. All Rights Reserved.