-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore_runner.py
40 lines (26 loc) · 973 Bytes
/
core_runner.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Core executer - rerun if network dormant, not recurrent.
Allows to force asyncrhonous behaviour.
Created on Wed Aug 3 10:37:27 2022
@author: gordonkoehn
"""
import core
###############################################################################
###############################################################################
if __name__ == '__main__':
validSimulationFound = False
maxNoTries = 30
## counter
trialNo = 0
while not validSimulationFound:
print("\nAttempt: " + str(trialNo+1))
if (maxNoTries < trialNo):
raise Exception("Maximal number of trials reached - no valid simulation was found.")
try:
core.simClasInfer(forceAsync=False, forcePhysical = False)
validSimulationFound = True
except Exception as e:
print(e)
trialNo += 1