org.decisiondeck.xmcda_oo.utils
Class Utils

java.lang.Object
  extended by org.decisiondeck.xmcda_oo.utils.Utils

public class Utils
extends Object


Constructor Summary
Utils()
           
 
Method Summary
 void addBestAlternativesPerCriterion(Set<Alternative> alts, EvaluationMatrix evaluations, float offset)
           
 void addWorstAlternativesPerCriterion(Set<Alternative> alts, EvaluationMatrix evaluations, float offset)
           
 Set<Criterion> getAllCriteria(Collection<ICoalitions> allCoals)
           
 Set<Criterion> getAllCriteriaFromThresholds(Collection<ICriteriaWithThresholds> allThresholds)
           
static
<T> NavigableSet<T>
newSortedSet(Set<T> order)
          Creates a new sorted set based on a predefined universe consisting of the objects given in the set.
static
<T> boolean
symMaxOne(IRdFloatMatrix<T,T> matrix)
          Checks that the matrix is such that m(a, b) + m(b, a) <= 1.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

addBestAlternativesPerCriterion

public void addBestAlternativesPerCriterion(Set<Alternative> alts,
                                            EvaluationMatrix evaluations,
                                            float offset)
                                     throws InvalidInputException
Throws:
InvalidInputException

getAllCriteria

public Set<Criterion> getAllCriteria(Collection<ICoalitions> allCoals)

addWorstAlternativesPerCriterion

public void addWorstAlternativesPerCriterion(Set<Alternative> alts,
                                             EvaluationMatrix evaluations,
                                             float offset)
                                      throws InvalidInputException
Throws:
InvalidInputException

symMaxOne

public static <T> boolean symMaxOne(IRdFloatMatrix<T,T> matrix)
                         throws InvalidInputException
Checks that the matrix is such that m(a, b) + m(b, a) <= 1. A small threshold above one is accepted to account for precision errors. The matrix must be complete and square.

Type Parameters:
T - the type of rows and columns.
Parameters:
matrix - the matrix to check. Not null.
Returns:
true iff there exists a pair (a, b) such that the entry at (a, b) plus the value at (b, a) is strictly greater than one.
Throws:
InvalidInputException - iff an entry in the matrix is missing.

getAllCriteriaFromThresholds

public Set<Criterion> getAllCriteriaFromThresholds(Collection<ICriteriaWithThresholds> allThresholds)

newSortedSet

public static <T> NavigableSet<T> newSortedSet(Set<T> order)
Creates a new sorted set based on a predefined universe consisting of the objects given in the set. The order is taken from the iteration on the set. The returned set is full, i.e. it contains all the objects in the predefined universe. A defensive copy is made, so changing the set content afterwards has no effect on the returned sorted set. The returned set may not be used with any object not belonging to the predefined universe.

Type Parameters:
T - the type of objects in the predefined universe.
Parameters:
order - the objects composing the universe, i.e., acceptable to the sorted set, in the order that must be used in the set. Should typically be a SortedSet or somehow define some ordering on its iteration.
Returns:
a new sorted set containing all the given objects. Not null but may be empty (in which case it will always stay empty).


Copyright © 2011. All Rights Reserved.