-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
99 lines (91 loc) · 3.18 KB
/
main.py
File metadata and controls
99 lines (91 loc) · 3.18 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import os
import platform
import argparse
if platform.system() == "Linux":
os.environ["ARCADE_HEADLESS"] = "True"
import time
import numpy as np
import pandas as pd
from src.sim.simulation import sim
import pyglet
"""
File to run simulation
"""
DEFAULT_PARAM_NAMES = ["k_s","k_d","k1","k2","k3","k4","k5","k6","tau"]
INDEP_PARAM_NAMES = ["ks_aux","kd_aux","ks_pinu","kd_pinu","kd_pinloc","ks_auxlax","kd_auxlax","k1","k2","k3","k4","k5","k6","tau"]
def make_default_param_series():
ks_range = 0.0553636
kd_range = 0.0278859
k1_range = 60
k2_range = 64
k3_range = 35
k4_range = 61
k5_range = 0.464545
k6_range = 0.959596
tau_range = 18
param_vals = [ks_range, kd_range, k1_range, k2_range, k3_range, k4_range, k5_range, k6_range, tau_range]
return pd.Series(param_vals, index=DEFAULT_PARAM_NAMES)
def make_indep_param_series():
ks_aux = 0.266778
kd_aux = 0.0224495
ks_pinu = 0.523434
kd_pinu = .0176172
kd_pinloc = 0.00191212
ks_auxlax = 0.0040202
kd_auxlax = 0.0257717
k1_range = 60
k2_range = 60
k3_range = 33
k4_range = 58
k5_range = 1
k6_range = 0.975758
tau_range =3
param_vals = [ks_aux, kd_aux, ks_pinu, kd_pinu, kd_pinloc, ks_auxlax, kd_auxlax, k1_range, k2_range, k3_range, k4_range, k5_range, k6_range, tau_range]
return pd.Series(param_vals, index=INDEP_PARAM_NAMES)
def get_simulation_config(circ_mod: str):
if circ_mod == "universal_syndeg":
return {
"cell_val_file": "src/sim/input/default_init_vals_higher_auxinw_in_shootward_vasc.json",
"v_file": "src/sim/input/default_vs.json",
"gparam_series": make_default_param_series(),
}
elif circ_mod == "indep_syndeg":
return {
"cell_val_file": "src/sim/input/indep_syndeg_init_vals.json",
"v_file": "src/sim/input/default_vs.json",
"gparam_series": make_indep_param_series(),
}
elif circ_mod == "aux_syndegonly":
return {
"cell_val_file": "src/sim/input/aux_syndegonly_init_vals.json",
"v_file": "src/sim/input/default_vs.json",
"gparam_series": make_default_param_series(),
}
else:
raise ValueError(f"Unsupported circ_mod: {circ_mod}")
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Run ARORA Simulation")
parser.add_argument("--circ_mod", type=str, default="universal_syndeg",
choices=["universal_syndeg", "indep_syndeg", "aux_syndegonly"],
help="Which circulation module to use")
parser.add_argument(
"--output_file", type=str, default="output",
help="Base name for the output files (without extension)"
)
args = parser.parse_args()
circ_mod = args.circ_mod
timestep = 1
vis = True
start_time = time.time()
config = get_simulation_config(circ_mod)
sim.main(
timestep,
vis,
cell_val_file=config["cell_val_file"],
v_file=config["v_file"],
gparam_series=config["gparam_series"],
output_file=args.output_file
)
end_time = time.time()
elapsed_time = end_time - start_time
print(f"Elapsed Time: {elapsed_time} seconds")