crispyn.additions ================= .. py:module:: crispyn.additions Functions --------- .. autoapisummary:: crispyn.additions.rank_preferences Module Contents --------------- .. py:function:: rank_preferences(pref, reverse=True) Rank alternatives according to MCDA preference function values. If more than one alternative have the same preference function value, they will be given the same rank value (tie). Parameters ------------ pref : ndarray Vector with MCDA preference function values for alternatives reverse : bool The boolean variable is True for MCDA methods that rank alternatives in descending order (for example, TOPSIS, CODAS) and False for MCDA methods that rank alternatives in ascending order (for example, VIKOR, SPOTIS) Returns --------- ndarray Vector with alternatives ranking. Alternative with 1 value is the best and has the first position in the ranking. Examples ---------- >>> rank = rank_preferences(pref, reverse = True)