Statistics
| Branch: | Revision:

mobicen / mobiExp.py @ e1cf8bea

History | View | Annotate | Download (934 Bytes)

1
import getopt
2
import code  # code.interact(local=dict(globals(), **locals()))
3
from pprint import pprint
4
import sys
5
from simulator import Simulator
6

    
7
if __name__ == '__main__':
8

    
9
    settingsFile = ''
10
    sectionExp = ''
11
    gui = False
12
    options, remainder = getopt.getopt(sys.argv[1:], '', ['sf=', 'en=', 'gui'])
13
    mand = set(['--sf', '--en'])
14
    opts = [x[0] for x in options]
15
    # print 'OPTIONS   :', opts
16
    if (not mand.issubset(opts)):
17
        print 'Mandatory args are: --sf (settings file) --en (experiment name)'
18
        sys.exit(1)
19
    for opt, arg in options:
20
        if opt in ('--sf'):
21
            settingsFile = arg
22
        if opt in ('--en'):
23
            sectionExp = arg
24
        if opt in ('--gui'):
25
            gui = True
26

    
27
    sim = Simulator(settingsFile, sectionExp, gui)
28
    print "Simulation Parameters\n"
29
    pprint(sim.params)
30
    #code.interact(local=dict(globals(), **locals()))
31
    sim.runSimulation()