コード例 #1
0
def test_transform_equation_def():
    with open('./test/gams/equation-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
        model = gp.transform()

        print("\nModel\n")
        print(model)
        print("\nSymbols:\n")
        for s in model.symbol():
            print(s)
コード例 #2
0
def test_variable_basic():
    with open('./test/gams/variable-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #3
0
def test_scalar_basic():
    with open('./test/gams/scalar-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #4
0
def test_parameter_tuple():
    with open('./test/gams/parameter-tuple.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #5
0
def test_assignment_basic():
    with open('./test/gams/assignment-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #6
0
def test_misc_comments():
    with open('./test/gams/misc-comments.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #7
0
def test_misc_include():
    with open('./test/gams/misc-include.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #8
0
def test_open_file():
    gp = GamsParser('./test/gams/set-ranged.gms')
    parse_tree = gp.parse()
    print(parse_tree.pretty())
コード例 #9
0
def test_real_siteanalysis():
    with open('./test/gams/real-siteanalysis.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #10
0
def test_real_shopmodel():
    with open('./test/gams/real-shopmodel.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #11
0
def test_real_eminit():
    with open('./test/gams/real-eminit.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #12
0
def test_set_multi():
    with open('./test/gams/set-multi.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #13
0
def test_equation_basic():
    with open('./test/gams/equation-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #14
0
def test_equation_elementindex():
    with open('./test/gams/equation-elementindex.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
コード例 #15
0
def test_equation_indexoperator():
    with open('./test/gams/equation-indexoperator.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())