예제 #1
0
def plan_cost(relaxed_plan, unit=False):
    return sum(operator.cost if not unit else 1 for operator in flatten(
        relaxed_plan)) if relaxed_plan is not None else None
예제 #2
0
def plan_length(relaxed_plan):
    return len(flatten(relaxed_plan)) if relaxed_plan is not None else None
예제 #3
0
def convex_hull_vertices(
        hull
):  # NOTE - old scipy uses points while the new scipy uses vertices
    if not hasattr(hull, 'vertices'):
        return sorted(set(flatten(hull.simplices)))
    return hull.vertices