org.decisiondeck.xmcda_oo.services.sorting
Class SortingAssigner

java.lang.Object
  extended by org.decisiondeck.xmcda_oo.services.sorting.SortingAssigner

public class SortingAssigner
extends Object


Field Summary
static double BINARY_TOLERANCE
          The allowed difference between a one, or a zero, and the observed values in the outranking matrix.
 
Constructor Summary
SortingAssigner()
           
 
Method Summary
 IOrderedAssignmentsToMultipleRead assign(SortingMode mode, Set<Alternative> alternatives, IAltZeroToOneMatrix outranking, ICatsAndProfs categories)
           Assigns each alternative according to the given sorting mode.
 IOrderedAssignmentsToMultiple both(Set<Alternative> alternatives, IAltZeroToOneMatrix outranking, ICatsAndProfs categories)
           Assigns each alternative to both the optimistic and the pessimistic categories, as well as to each category in between.
 IOrderedAssignments optimistic(Set<Alternative> alternatives, IAltZeroToOneMatrix outranking, ICatsAndProfs categories)
           Assigns each alternative to the lowest category such that the alternative does not outrank the up profile corresponding to that category and the profile outranks the alternative.
 IOrderedAssignments pessimistic(Set<Alternative> alternatives, IAltZeroToOneMatrix outranking, ICatsAndProfs categories)
           Assigns each alternative to the highest category such that the alternative outranks the profile corresponding to that category.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BINARY_TOLERANCE

public static double BINARY_TOLERANCE
The allowed difference between a one, or a zero, and the observed values in the outranking matrix.

Constructor Detail

SortingAssigner

public SortingAssigner()
Method Detail

both

public IOrderedAssignmentsToMultiple both(Set<Alternative> alternatives,
                                          IAltZeroToOneMatrix outranking,
                                          ICatsAndProfs categories)
                                   throws InvalidInputException

Assigns each alternative to both the optimistic and the pessimistic categories, as well as to each category in between.

The input is valid if the given alternatives and the profiles in the categories are a subset of the alternatives found in the outranking matrix, the categories are complete, the outranking is a binary matrix, thus has only one and zero, and has entries for all alternatives and profiles consider. A small tolerance is allowed, e.g. 1-1e-5 will count as a one.

Parameters:
alternatives - the alternatives to assign.
outranking - not null.
categories - not null.
Returns:
not null.
Throws:
InvalidInputException - if the input data is invalid.

optimistic

public IOrderedAssignments optimistic(Set<Alternative> alternatives,
                                      IAltZeroToOneMatrix outranking,
                                      ICatsAndProfs categories)
                               throws InvalidInputException

Assigns each alternative to the lowest category such that the alternative does not outrank the up profile corresponding to that category and the profile outranks the alternative.

The input is valid if the given alternatives and the profiles in the categories are a subset of the alternatives found in the outranking matrix, the categories are complete, the outranking is a binary matrix, thus has only one and zero, and has entries for all alternatives and profiles consider. A small tolerance is allowed, e.g. 1-1e-5 will count as a one.

Parameters:
alternatives - the alternatives to assign.
outranking - not null.
categories - not null.
Returns:
not null.
Throws:
InvalidInputException - if the input data is invalid.

pessimistic

public IOrderedAssignments pessimistic(Set<Alternative> alternatives,
                                       IAltZeroToOneMatrix outranking,
                                       ICatsAndProfs categories)
                                throws InvalidInputException

Assigns each alternative to the highest category such that the alternative outranks the profile corresponding to that category.

The input is valid if the given alternatives and the profiles in the categories are a subset of the alternatives found in the outranking matrix, the categories are complete, the outranking is a binary matrix, thus has only one and zero, and has entries for all alternatives and profiles consider. A small tolerance is allowed, e.g. 1-1e-5 will count as a one.

Parameters:
alternatives - the alternatives to assign.
outranking - not null.
categories - not null.
Returns:
not null.
Throws:
InvalidInputException - if the input data is invalid.

assign

public IOrderedAssignmentsToMultipleRead assign(SortingMode mode,
                                                Set<Alternative> alternatives,
                                                IAltZeroToOneMatrix outranking,
                                                ICatsAndProfs categories)
                                         throws InvalidInputException

Assigns each alternative according to the given sorting mode.

The input is valid if the given alternatives and the profiles in the categories are a subset of the alternatives found in the outranking matrix, the categories are complete, the outranking is a binary matrix, thus has only one and zero, and has entries for all alternatives and profiles consider. A small tolerance is allowed, e.g. 1-1e-5 will count as a one.

If the sorting mode is BOTH, the returned object implements IOrderedAssignmentsToMultiple, otherwise, it implements IOrderedAssignments.

Parameters:
mode - not null.
alternatives - the alternatives to assign.
outranking - not null.
categories - not null.
Returns:
not null.
Throws:
InvalidInputException - if the input data is invalid.


Copyright © 2011. All Rights Reserved.