Loading tools/soar_utilities.py +1 −30 Original line number Diff line number Diff line Loading @@ -238,21 +238,12 @@ def get_pareto_front(process_graph, plot_all=False, objective="linear", ) print(strProblem) tElapsedOuter = np.ones(5) * np.nan tStartOuter = time.perf_counter() tElapsedOuter[0] = time.perf_counter() - tStartOuter if plot_all: fig = plot_graph(process_graph) fig.canvas.draw() fig.canvas.flush_events() plt.show(block=False) process_graph.add_graph_info(verbose) tElapsedOuter[1] = time.perf_counter() - tStartOuter # iNumberOfArc = process_graph.iNumberOfArc match strObjective: case "FlowOnly": process_graph.xSensorCandidate[:, :-1] = 0 Loading Loading @@ -290,9 +281,6 @@ def get_pareto_front(process_graph, plot_all=False, objective="linear", # nLayout = 2 iLayoutBnd = [0, nLayout] # ==================================== tElapsedOuter[2] = time.perf_counter() - tStartOuter feval.lapse = np.ones([nLayout, nCriteria]) * np.nan xMeasured_default = process_graph.xMeasured.copy() Loading Loading @@ -321,8 +309,6 @@ def get_pareto_front(process_graph, plot_all=False, objective="linear", ) Solutions = np.where(xLayoutOnFront)[0] iObjectives = feval.criteria[Solutions, :] tElapsedOuter[3] = time.perf_counter() - tStartOuter pass else: Loading @@ -345,7 +331,6 @@ def get_pareto_front(process_graph, plot_all=False, objective="linear", strProblem, ) tElapsedOuter[3] = time.perf_counter() - tStartOuter iObjectives = iTree[:, 2 + np.arange(nCriteria)] iObjectives[:, 1] = -iObjectives[:, 1] if nCriteria >= 3: Loading Loading @@ -445,17 +430,6 @@ def get_one_result(process_graph, layout, objective="linear", verbose=5): ) print(strProblem) tElapsedOuter = np.ones(5) * np.nan tStartOuter = time.perf_counter() tElapsedOuter[0] = time.perf_counter() - tStartOuter # this is where cutset enumeration happens process_graph.add_graph_info(verbose) tElapsedOuter[1] = time.perf_counter() - tStartOuter # iNumberOfArc = process_graph.iNumberOfArc match strObjective: case "FlowOnly": process_graph.xSensorCandidate[:, :-1] = 0 Loading Loading @@ -492,9 +466,6 @@ def get_one_result(process_graph, layout, objective="linear", verbose=5): iLayoutBnd = [0, nLayout] # ==================================== tElapsedOuter[2] = time.perf_counter() - tStartOuter feval.lapse = np.ones([nLayout, nCriteria]) * np.nan xMeasured_default = process_graph.xMeasured.copy() Loading Loading
tools/soar_utilities.py +1 −30 Original line number Diff line number Diff line Loading @@ -238,21 +238,12 @@ def get_pareto_front(process_graph, plot_all=False, objective="linear", ) print(strProblem) tElapsedOuter = np.ones(5) * np.nan tStartOuter = time.perf_counter() tElapsedOuter[0] = time.perf_counter() - tStartOuter if plot_all: fig = plot_graph(process_graph) fig.canvas.draw() fig.canvas.flush_events() plt.show(block=False) process_graph.add_graph_info(verbose) tElapsedOuter[1] = time.perf_counter() - tStartOuter # iNumberOfArc = process_graph.iNumberOfArc match strObjective: case "FlowOnly": process_graph.xSensorCandidate[:, :-1] = 0 Loading Loading @@ -290,9 +281,6 @@ def get_pareto_front(process_graph, plot_all=False, objective="linear", # nLayout = 2 iLayoutBnd = [0, nLayout] # ==================================== tElapsedOuter[2] = time.perf_counter() - tStartOuter feval.lapse = np.ones([nLayout, nCriteria]) * np.nan xMeasured_default = process_graph.xMeasured.copy() Loading Loading @@ -321,8 +309,6 @@ def get_pareto_front(process_graph, plot_all=False, objective="linear", ) Solutions = np.where(xLayoutOnFront)[0] iObjectives = feval.criteria[Solutions, :] tElapsedOuter[3] = time.perf_counter() - tStartOuter pass else: Loading @@ -345,7 +331,6 @@ def get_pareto_front(process_graph, plot_all=False, objective="linear", strProblem, ) tElapsedOuter[3] = time.perf_counter() - tStartOuter iObjectives = iTree[:, 2 + np.arange(nCriteria)] iObjectives[:, 1] = -iObjectives[:, 1] if nCriteria >= 3: Loading Loading @@ -445,17 +430,6 @@ def get_one_result(process_graph, layout, objective="linear", verbose=5): ) print(strProblem) tElapsedOuter = np.ones(5) * np.nan tStartOuter = time.perf_counter() tElapsedOuter[0] = time.perf_counter() - tStartOuter # this is where cutset enumeration happens process_graph.add_graph_info(verbose) tElapsedOuter[1] = time.perf_counter() - tStartOuter # iNumberOfArc = process_graph.iNumberOfArc match strObjective: case "FlowOnly": process_graph.xSensorCandidate[:, :-1] = 0 Loading Loading @@ -492,9 +466,6 @@ def get_one_result(process_graph, layout, objective="linear", verbose=5): iLayoutBnd = [0, nLayout] # ==================================== tElapsedOuter[2] = time.perf_counter() - tStartOuter feval.lapse = np.ones([nLayout, nCriteria]) * np.nan xMeasured_default = process_graph.xMeasured.copy() Loading