41 lines
1.5 KiB
Python
41 lines
1.5 KiB
Python
#Utility Script for running main
|
|
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
|
|
#Samples
|
|
num = 10
|
|
exception = None
|
|
flag = 0
|
|
while(num < 100000):
|
|
try:
|
|
for size in range(5, 51, 5):
|
|
for a in range(75, 105, 10):
|
|
ntype = "dag"
|
|
alpha = a/100
|
|
if(num > 100001 and size > 20):
|
|
flag = 1
|
|
break
|
|
os.system('python main.py -s ' + str(size) + ' ' + '-t ' + ntype + ' ' + '-n ' + str(num) + ' ' + '-a ' + str(alpha))
|
|
#t = subprocess.call('python main.py -s ' + str(size) + ' ' + '-t ' + ntype + ' ' + '-n ' + str(num) + ' ' + '-a ' + str(alpha), shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
|
|
if exception or flag:
|
|
break
|
|
ntype = "polytree"
|
|
os.system('python main.py -s ' + str(size) + ' ' + '-t ' + ntype + ' ' + '-n ' + str(num) + ' ' + '-a ' + str(alpha))
|
|
#t = subprocess.call('python main.py -s ' + str(size) + ' ' + '-t ' + ntype + ' ' + '-n ' + str(num) + ' ' + '-a ' + str(alpha), shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
|
|
print("Finished with a=" + str(a) + ' size= ' + str(size) + ' num=' + str(num))
|
|
if exception or flag:
|
|
break
|
|
if exception or flag:
|
|
break
|
|
if exception or flag:
|
|
break
|
|
except KeyboardInterrupt:
|
|
exception = sys.exit()
|
|
num = num*10
|
|
if flag:
|
|
break
|
|
|
|
sys.exit()
|