本文整理汇总了Python中PyXMCDA.getProfilesID方法的典型用法代码示例。如果您正苦于以下问题:Python PyXMCDA.getProfilesID方法的具体用法?Python PyXMCDA.getProfilesID怎么用?Python PyXMCDA.getProfilesID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyXMCDA
的用法示例。
在下文中一共展示了PyXMCDA.getProfilesID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_input_data
# 需要导入模块: import PyXMCDA [as 别名]
# 或者: from PyXMCDA import getProfilesID [as 别名]
def get_input_data(input_dir, filenames, params, **kwargs):
trees = _get_trees(input_dir, filenames)
d = _create_data_object(params)
for p in params:
if p == "alternatives":
d.alternatives = px.getAlternativesID(trees["alternatives"])
elif p == "profiles":
d.profiles = px.getProfilesID(trees["profiles"])
elif p == "categories_profiles":
comparison_with = kwargs.get("comparison_with")
if comparison_with is None:
comparison_with = px.getParameterByName(trees["method_parameters"], "comparison_with")
d.categories_profiles = _get_categories_profiles(trees.get("categories_profiles"), comparison_with)
elif p == "categories_rank":
categories = px.getCategoriesID(trees["categories"])
d.categories_rank = px.getCategoriesRank(trees["categories"], categories)
elif p == "comparison_with":
d.comparison_with = px.getParameterByName(trees["method_parameters"], "comparison_with")
elif p == "concordance":
alternatives = px.getAlternativesID(trees["alternatives"])
comparison_with = kwargs.get("comparison_with")
if trees.has_key("methos_parameters"):
comparison_with = px.getParameterByName(trees["method_parameters"], "comparison_with")
if kwargs.get("use_partials") is not None:
use_partials = kwargs.get("use_partials")
else:
if trees.has_key("methos_parameters"):
parameter = px.getParameterByName(trees["method_parameters"], "use_partials")
use_partials = True if parameter == "true" else False
categories_profiles = None
profiles = None
if comparison_with in ("boundary_profiles", "central_profiles"):
categories_profiles = _get_categories_profiles(trees["categories_profiles"], comparison_with)
if comparison_with == "profiles":
profiles = px.getProfilesID(trees["profiles"])
d.concordance = _get_alternatives_comparisons(
trees["concordance"],
alternatives,
profiles=profiles,
categories_profiles=categories_profiles,
use_partials=use_partials,
)
elif p == "crisp_concordance":
alternatives = px.getAlternativesID(trees["alternatives"])
comparison_with = kwargs.get("comparison_with")
if trees.has_key("methos_parameters"):
comparison_with = px.getParameterByName(trees["method_parameters"], "comparison_with")
if kwargs.get("use_partials") is not None:
use_partials = kwargs.get("use_partials")
else:
if trees.has_key("methos_parameters"):
parameter = px.getParameterByName(trees["method_parameters"], "use_partials")
use_partials = True if parameter == "true" else False
categories_profiles = None
profiles = None
if comparison_with in ("boundary_profiles", "central_profiles"):
categories_profiles = _get_categories_profiles(trees["categories_profiles"], comparison_with)
if comparison_with == "profiles":
profiles = px.getProfilesID(trees["profiles"])
d.concordance = _get_alternatives_comparisons(
trees["concordance"],
alternatives,
profiles=profiles,
categories_profiles=categories_profiles,
use_partials=use_partials,
use_value=False,
)
elif p == "credibility":
alternatives = px.getAlternativesID(trees["alternatives"])
comparison_with = kwargs.get("comparison_with")
if not comparison_with:
comparison_with = px.getParameterByName(trees["method_parameters"], "comparison_with")
if comparison_with in ("boundary_profiles", "central_profiles"):
categories_profiles = _get_categories_profiles(trees["categories_profiles"], comparison_with)
else:
categories_profiles = None
eliminate_cycles_method = px.getParameterByName(trees.get("method_parameters"), "eliminate_cycles_method")
tree = trees.get("credibility")
if eliminate_cycles_method == "cut_weakest" and tree is None:
raise RuntimeError(
#.........这里部分代码省略.........