pyrepo_mcda.mcda_methods.prosa_c ================================ .. py:module:: pyrepo_mcda.mcda_methods.prosa_c Classes ------- .. autoapisummary:: pyrepo_mcda.mcda_methods.prosa_c.PROSA_C Module Contents --------------- .. py:class:: PROSA_C Bases: :py:obj:`pyrepo_mcda.mcda_methods.promethee.PROMETHEE_II` PROMETHEE for Sustainability Assessment - Criteria (PROSA-C) method for ranking alternatives using preference flows and a compensation coefficient. .. py:method:: __call__(matrix, weights, types, preference_functions=None, p=None, q=None, s=None) .. py:method:: _prosa_c(self, matrix, weights, types, preference_functions, p, q, s) :staticmethod: Score alternatives provided in the decision matrix `matrix` using criteria `weights` and criteria `types`. Parameters ---------- matrix : ndarray Decision matrix with m alternatives in rows and n criteria in columns. weights: ndarray Criteria weights. The sum of weights must be equal to 1. types: ndarray Criteria types. Profit criteria are represented by 1 and cost by -1. preference_functions : list List with methods containing preference functions for calculating the preference degree for each criterion. p : ndarray Vector with values representing the threshold of absolute preference. q : ndarray Vector with values representing the threshold of indifference. s : ndarray Vector with values of the coefficient sj for the criteria Returns ------- ndrarray Preference values of each alternative. The best alternative has the highest preference value. Examples -------- >>> prosa_c = PROSA_C() >>> preference_functions = [prosa_c._linear_function for pf in range(len(weights))] >>> u = np.sqrt(np.sum(np.square(np.mean(matrix, axis = 0) - matrix), axis = 0) / matrix.shape[0]) >>> p = 2 * u >>> q = 0.5 * u >>> s = np.repeat(0.3, len(weights)) >>> pref = prosa_c(matrix, weights, types, preference_functions, p = p, q = q, s = s) >>> rank = rank_preferences(pref, reverse = True)