Commit 6605a4e0 authored by Blais, Chris's avatar Blais, Chris
Browse files

WIP: troubleshooting issue with mrror approach, rolling back changes to see if problem persists

parent 944f6852
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
from .. import context
 No newline at end of file

context.py

0 → 100644
+21 −0
Original line number Diff line number Diff line
import os
import sys

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:
    print("soar toolbox already in path")

# add module path
module_path = os.path.dirname(os.path.abspath(__file__))
if module_path not in sys.path:
    sys.path.insert(0, module_path)
else:
    print("path already in sys.path")

+1 −15
Original line number Diff line number Diff line
@@ -19,20 +19,6 @@ if soar_path not in sys.path:
    sys.path.insert(0, soar_path)


from soar.graph_labeling.fDefineSystem import ProcessGraph
from soar.graph_labeling.fPlotGraph import plot_graph
from soar.graph_labeling.genobs.fGenObs import general_observability
from soar.graph_labeling.genred.fGenRed import genred
from soar.optimization.fParetoDominance import pareto_dominance
from soar.optimization.fFigurePareto import figure_pareto
from soar.optimization.fParetoSearch import pareto_search
from soar.optimization.fComputeFrontWithAddedRedundancy import (
    compute_front_with_added_redundancy,
)

import soar.optimization.fEvaluate as feval


def define_system(iIncidence=[], coordinates = [], verbose=5,
                  arcSplitter =[[5 - 1, 6 - 1, 7 - 1]],
                  arcEqualComposition = [[1-1, 2-1], [5 - 1, 6 - 1, 7 - 1, 8-1]],
@@ -237,7 +223,7 @@ def get_pareto_front(process_graph, plot_all=False, objective="linear",
            print("Unknown option")
            pass

    # ncriteria is if we are looking at red and obs, ncrit=2 is just obs
    # ncriteria is if we are looking at red and obs, ncrit=2 is just obs, nCriteria 3 is all 3
    nCriteria = 3
    strProblem = (
        "Front_"
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ else:
from soar.graph_labeling.genobs.fGenObs import general_observability
from soar.graph_labeling.genred.fGenRed import genred
from soar.graph_labeling.fDefineSystem import ProcessGraph
from setup_example_soar import define_system, get_pareto_front, get_one_result
from tools.soar_utilities import define_system, get_pareto_front, get_one_result
from soar.optimization.fEvaluate import evaluate_obs_red

# for plotting
+40 −29
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ else:
from soar.graph_labeling.genobs.fGenObs import general_observability
from soar.graph_labeling.genred.fGenRed import genred
from soar.graph_labeling.fDefineSystem import ProcessGraph
from setup_example_soar import define_system, get_pareto_front, get_one_result
from tools.soar_utilities import define_system, get_pareto_front, get_one_result
from soar.optimization.fEvaluate import evaluate_obs_red

# for plotting
@@ -86,6 +86,13 @@ def check_incidence(iIncidence):

def test_linear_soar(plot=False):
    # establish simple membrane system for testing


    pgraph_path = os.path.join(module_path, "documenting_failures","soar_pgraphs","ccro_pgraph.pkl")
    if os.path.exists(pgraph_path):
        with open(pgraph_path, "rb") as f: 
            pgraph = pickle.load(f)
    else: 
        iIncidence = np.array(
            [   # e   P1  Mx Me1 Sp1  P2
                [-1, +1,  0,  0,  0,  0],  # 1
@@ -115,6 +122,10 @@ def test_linear_soar(plot=False):
            numberOfComponents = 3,
            )
        pgraph.add_graph_info(verbose=5)
        with open(pgraph_path, "wb") as f: 
            pickle.dump(pgraph,f)

    # 
    xMeasured_default = pgraph.xMeasured

    # results = get_pareto_front(pgraph, objective="linear", verbose=5)
Loading