Ejemplo n.º 1
0
def run(source_file, options, xsl_pp_cb):
    try:
        print('Parsing model file')
        parser = LEMSParser(xsl_pp_cb, options.include_dirs,
                            ['neuroml'])
        parser.parse_file(source_file)
        model = parser.get_model()
        #print model

        print('Resolving model')
        model.resolve_model()
        #print model

        print('Building simulation')
        sim = SimulationBuilder(model).build()
        #sim.dump()

        print('Running simulation')
        sim.run()

        process_simulation_output(sim, options)

    except ParseError as e:
        print('Caught ParseError - ' + str(e))
    except ModelError as e:
        print('Caught ModelError - ' + str(e))
    #except SimBuildError as e:
        #print('Caught SimBuildError - ' + str(e))
    except SimError as e:
        print('Caught SimError - ' + str(e))
Ejemplo n.º 2
0
    if len(sys.argv) not in [2,3]:
        print('Usage: runlems [-nogui] <model-file>')
        sys.exit(-1)

    nogui = False
    if len(sys.argv) == 2:
        model_file = sys.argv[1]
    else:
        if sys.argv[1] == '-nogui':
            nogui = True
        model_file = sys.argv[2]

    try:
        print('Parsing model file')
        parser = LEMSParser(xslt_preprocessor_callback)
        parser.parse_file(model_file)
        model = parser.get_model()
        #print model

        print('Resolving model')
        model.resolve_model()
        #print model
        #sys.exit(0)

        print('Building simulation')
        sim = SimulationBuilder(model).build()
        #dump_runnables(sim)
        #sys.exit(0)

        print('Running simulation')
Ejemplo n.º 3
0
if len(sys.argv) not in [2,3]:
    print 'Usage: runlems [-nogui] <model-file>'
    sys.exit(-1)

nogui = False
if len(sys.argv) == 2:
    model_file = sys.argv[1]
else:
    if sys.argv[1] == '-nogui':
        nogui = True
    model_file = sys.argv[2]

try:
    print 'Parsing model file'
    parser = LEMSParser()
    parser.init_parser()
    parser.parse_file(model_file)
    model = parser.get_model()
    #print model
    
    print 'Resolving model'
    model.resolve_model()
    #print model

    print 'Building simulation'
    sim = SimulationBuilder(model).build()


except ParseError as e:
    print 'Caught ParseError - ' + str(e)
Ejemplo n.º 4
0
if len(sys.argv) not in [2, 3]:
    print 'Usage: runlems [-nogui] <model-file>'
    sys.exit(-1)

nogui = False
if len(sys.argv) == 2:
    model_file = sys.argv[1]
else:
    if sys.argv[1] == '-nogui':
        nogui = True
    model_file = sys.argv[2]

try:
    print 'Parsing model file'
    parser = LEMSParser()
    parser.init_parser()
    parser.parse_file(model_file)
    model = parser.get_model()
    #print model

    print 'Resolving model'
    model.resolve_model()
    #print model

    print 'Building simulation'
    sim = SimulationBuilder(model).build()

except ParseError as e:
    print 'Caught ParseError - ' + str(e)
except ModelError as e: