-
Notifications
You must be signed in to change notification settings - Fork 1
/
runsims.py
51 lines (35 loc) · 1.3 KB
/
runsims.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- coding: utf-8 -*-
"""Run all the simulations. For whatever reason
this works best only when run within Spyder.
"""
import os
import sys
from os.path import join, dirname
import votesim
import subprocess
DIRNAME = dirname(__file__)
DIRNAME_SIMS = join(DIRNAME, 'sims')
dirname1 = join(DIRNAME_SIMS, 'simple3way')
sys.path.insert(0, dirname1)
import definitions
if __name__ == '__main__':
dirname1 = join(DIRNAME_SIMS, 'simple3way')
os.chdir(dirname1)
# votesim.utilities.misc.execfile('run.py')
# votesim.utilities.misc.execfile('plot.py')
print('Running run.py for simple3way')
exec(open('run.py').read(), globals(), locals())
print('Running plot.py for simple3way')
exec(open('plot.py').read(), globals(), locals())
dirname1 = join(DIRNAME_SIMS, 'spatial5dim')
os.chdir(dirname1)
print('Running run.py for spatial5dim')
exec(open('run.py').read(), globals(), locals())
print('Running plot.py for spatial5dim')
exec(open('plot.py').read(), globals(), locals())
dirname1 = join(DIRNAME_SIMS, 'tactical')
os.chdir(dirname1)
print('Running run.py for tactical')
exec(open('run.py').read(), globals(), locals())
print('Running plot.py for tactical')
exec(open('plot.py').read(), globals(), locals())