-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
52 lines (36 loc) · 944 Bytes
/
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
45
46
47
48
49
50
51
52
import aiomas
import asyncio
import numpy
import time
from Simulator import Simulator
import yaml
#import cProfile
def main():
try:
t0 = time.time()
#CREATION STEP
config = read_config()
Sim = Simulator(config)
#SIMULATION STEP
ts0 = time.time()
aiomas.run(until=Sim.run())
ts1 = time.time()
except Exception as e:
print(e)
print('ops need to finish!')
finally:
# Sim.shutdown()
t1 = time.time()
print('total time %f' % (t1 - t0))
print('simulation time: %f' %(ts1-ts0) )
print('done')
#close everything
def read_config():
stream = open('config.yaml', 'r')
dictionary = yaml.load(stream,Loader=yaml.FullLoader)
return dictionary
if __name__ == '__main__':
#config = read_config()
#print(config)
main()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/