Commit 228c8a97 authored by Blais, Chris's avatar Blais, Chris
Browse files

updated soar path for cades

parent 9b865ba9
Loading
Loading
Loading
Loading
+54 −43
Original line number Diff line number Diff line
@@ -8,7 +8,11 @@ import yaml
import numpy as np
from time import time

if sys.platform == "win32":
    soar_path = os.path.join(r"C:\Users\tjf\Documents\01_gitlab_repos\soar\python")
elif sys.platform == "linux":
    soar_path = os.path.join("/home/tjf/01_nawi/soar/python")
    
if soar_path not in sys.path:
    sys.path.insert(0, soar_path)
else:
@@ -107,6 +111,10 @@ def test_nonlinear_soar(plot=False, random_sampling=False, ptype=1, verbose=1):
    # mem 4 (h), mix 4 (i), 
    # split 1 (j), recyc valve (k)
    # environment (l)

    # process graph takes ~12 hours to generate, make beforehand and save
    pilot_pgraph_path = os.path.join(module_path, "documenting_failures", "soar_pgraphs", "pilot_pgraph.pkl")
    if not os.path.exists(pilot_pgraph_path):
        iIncidence = np.array(
            [   # a   b   c   d   e   f   g   h   i   j   k   l
                [+1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1],  # 1
@@ -146,9 +154,12 @@ def test_nonlinear_soar(plot=False, random_sampling=False, ptype=1, verbose=1):
            )
        pgraph.add_graph_info(verbose=5)
        xMeasured_default = pgraph.xMeasured
    else:
        with open(pilot_pgraph_path, "rb") as f:
            pgraph = pickle.load(f)  
      
    # load pareto optimal layouts if they exist, run and save if they don't
    results_path = os.path.join(module_path, "documenting_failures", "pareto_fronts", "bilinear_pareto_front.pkl")
    results_path = os.path.join(module_path, "documenting_failures", "pareto_fronts", "pilot_bl_pareto_front.pkl")
    if os.path.exists(results_path):
        with open(results_path, "rb") as f:
            results = pickle.load(f)
@@ -159,7 +170,7 @@ def test_nonlinear_soar(plot=False, random_sampling=False, ptype=1, verbose=1):
            pickle.dump(results, f)

    # file the results for the pareto front. 
    soar_or_results_path = os.path.join(module_path, "documenting_failures", "pareto_fronts", "bilinear_pareto_front_labels.pkl")
    soar_or_results_path = os.path.join(module_path, "documenting_failures", "pareto_fronts", "pilot_bl_pareto_front_labels.pkl")
    if os.path.exists(soar_or_results_path):
        with open(soar_or_results_path, "rb") as f:
            soar_or_results = pickle.load(f)
@@ -181,7 +192,7 @@ def test_nonlinear_soar(plot=False, random_sampling=False, ptype=1, verbose=1):
    # # x0_file = os.path.join(os.path.dirname(__file__), "x0_solved.pkl")
    # with open(x0_file, "rb") as f:
    #     x0 = pickle.load(f)
    x0_file = os.path.join(module_path, "operating_point_search", "saved_x0", "x0_ccro_final_ans_rev2.yaml")
    x0_file = os.path.join(module_path, "operating_point_search", "saved_x0", "x0_pilot_final_ans.yaml")
    with open(x0_file, "r") as f: 
        x0 = yaml.safe_load(f)
    # typecheck