res = [self.symbolic_aggregation_operator(j / len(res_dic.keys()), self.linguistic_set_by_id(self.best_set).size) for (i, j) in res_dic.items()] return res @property def linguistic_sets(self): return self._linguistic_sets @property def best_set(self): return self._best_set def linguistic_set_by_id(self, id): return self.linguistic_sets.get(id, None) def linguistic_set_by_size(self, size): return self.linguistic_set_by_id(self.get_set_id_by_size(size)) if __name__ == '__main__': maker = LHDecisionMaker() maker.retrieve_sets() print_dictionary(maker.linguistic_sets) maker.choose_best_set() print("best option: " + str(maker.best_set)) maker.define_alternatives() maker.retrieve_estimates() res,translations = maker.lh_two_tuple_decision() print ("Best option: " + str(res)) print ("Its translations: " + str(translations))
matrix.append(row) return matrix def calculate_total_by_alternative(self): sum = 0 res_dic = {} for row in self.matrix: for (j, val) in enumerate(row): try: res_dic[j] += self.symbolic_aggregation_operator_reverse(val) except KeyError: res_dic[j] = self.symbolic_aggregation_operator_reverse(val) res = [self.symbolic_aggregation_operator(j / len(res_dic.keys())) for (i, j) in res_dic.items()] return res if __name__ == "__main__": print("Starting to initialize the Decision Maker") maker = DecisionMaker() maker.define_estimate_options() maker.define_alternatives() estimates = maker.get_estimates_from_experts() print("Got estimates from agents: ") print_list(estimates) maker.map_estimates_to_integers() print("Mapped estimates: ") print_dictionary(maker.get_map_estimates()) maker.two_tuples_decision()