analyse_xml.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:py4design 作者: chenkianwee 项目源码 文件源码
def extract_pareto_front_inds(inds, min_max_list):
    """
    This function extract the Pareto front from the list of score_2dlist.

    Parameters
    ----------            
    inds : list of xml minidom Node
        The individuals to extract the Pareto front from.

    min_max_list : list of ints
        The min max list is in this format, [0,1]. 0 = minimise, 1 = maximise. The min max list must correspond to the two result lists.

    Returns
    -------
    pareto front : list of xml minidom Node
        The population of individuals on the front.

    non pareto front : list of xml minidom Node
        The population of individuals not on the front.
    """
    pareto_front = []
    non_pareto_front = []
    score_2dlist = inds_2_score_2dlist(inds)
    for ind in inds:
        score_list = get_score(ind)
        if (len(score_list)-1) !=0:     
            if on_pareto_front(score_list, score_2dlist, min_max_list):
                pareto_front.append(ind)
            else:
                non_pareto_front.append(ind)
    return pareto_front, non_pareto_front
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号