-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.py
39 lines (34 loc) · 1.35 KB
/
runtests.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
import json
import os
import datetime
from numpy import arange, linspace
from copy import deepcopy
import dpath.util
from subprocess import Popen
# to install modules run pip3 install numpy dpath
f = open("params_example_V2.json")
default_settings = json.load(f)
f.close()
settings = {
"Transmission": ("virus/Transmission/Mean", [0.05, 0.15, 0.01]),
"Lethality": ("virus/Lethality/Mean", [0.8, 1.0, 0.02])
}
for param in settings:
print(param)
new_settings = deepcopy(default_settings)
nums = settings[param][1]
interval = arange(nums[0], nums[1] + 1 if isinstance(nums[2],
int) else nums[1] + (nums[2]/10), nums[2])
for val in interval:
currentDT = datetime.datetime.now()
print("\t" + str(round(val, 2)) + " Stamp: " + str(currentDT.hour) + ":" + str(currentDT.minute) + ":" + str(currentDT.second))
new_settings["statisticsFolderExtension"] = str(
param) + "/" + str(round(val, 2))
dpath.util.set(new_settings, settings[param][0], round(val, 2))
f = open("build\params.json", "w")
json.dump(new_settings, f)
f.close()
for i in range(5):
process = Popen(
[".\AASMA_2020.exe", "-logFile", "log.txt", "-noGraphics", "-batchMode"], cwd=r'Build', shell=True)
process.wait()