-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexp_2.py
58 lines (49 loc) · 2.18 KB
/
exp_2.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
52
53
54
55
56
57
58
import subprocess
import time
if __name__ == '__main__':
import multiprocessing
num_cores = multiprocessing.cpu_count()
cores_per_task = 1
max_tasks = num_cores // cores_per_task
child_processes = []
""" Infinite horizon """
for num_disc_mf in [50, 80, 120]:
for variant in ["fpi",]:
for game in ['SIS', 'Buffet', 'Advertisement']:
p = subprocess.Popen(['python',
'./main_fp.py',
f'--inf',
f'--cores={cores_per_task}',
f'--game={game}',
f'--fp_iterations={100}',
f'--variant={variant}',
f'--num_disc_mf={num_disc_mf}',
])
child_processes.append(p)
time.sleep(5)
while len(child_processes) >= max_tasks:
for p in list(child_processes):
if p.poll() is not None:
child_processes.remove(p)
time.sleep(1)
for num_disc_mf in range(10, 205, 10):
for variant in ["fp", ]:
for game in ['SIS', 'Buffet', 'Advertisement']:
p = subprocess.Popen(['python',
'./main_fp.py',
f'--inf',
f'--cores={cores_per_task}',
f'--game={game}',
f'--fp_iterations={1000}',
f'--variant={variant}',
f'--num_disc_mf={num_disc_mf}',
])
child_processes.append(p)
time.sleep(5)
while len(child_processes) >= max_tasks:
for p in list(child_processes):
if p.poll() is not None:
child_processes.remove(p)
time.sleep(1)
for p in child_processes:
p.wait()