示例#1
0
def run_gui(args):
    from gui.MainWindow import MainWindow
    integrators = {
        'euler': Euler(),
        'leapfrog': Leapfrog(),
        'hermite': Hermite()
    }
    try:
        integrator = integrators[args.integrator]
    except:
        print("Integrator must one of: euler, leapfrog, hermite")
        exit(-1)
    sim = simulation.SimRun(n_steps=args.n,
                            n_stars=args.s,
                            integrator=integrator)
    w = MainWindow(sim)
    w.simulate()
示例#2
0
def run_replay(args):
    from gui.MainWindow import MainWindow
    sim = simulation.Player(args.replay)
    w = MainWindow(sim)
    w.simulate()