-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
44 lines (36 loc) · 1.04 KB
/
main.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
import sys
import numpy as np
from src.models.models import GSSEMModel
from src.utils.plot_utils import plot
def main():
model = GSSEMModel(time=100)
if len(sys.argv) != 2:
print("Argv != 2")
print("Usage: python main.py [show_params|show_docs|run_simulation]")
sys.exit(1)
elif sys.argv[1] == "show_params":
print()
model.params.print_params()
sys.exit(0)
elif sys.argv[1] == "show_docs":
print("Model documentation:")
model.simulation_docs()
sys.exit(0)
elif sys.argv[1] == "run_simulation":
# Run simulation
x, y = model.run_simulation()
print("Simulation completed.")
x = np.array(x)
y = np.array(y)
print("x: ", x)
print(x.shape)
print("y: ", y)
print(y.shape)
plot(x, y)
sys.exit(0)
else:
print("Invalid command.")
print("Usage: python main.py [show_params|show_docs|run_simulation]")
sys.exit(1)
if __name__ == "__main__":
main()