Quellcode durchsuchen

Model works and seems decently calibrated

Yentl Van Tendeloo vor 8 Jahren
Ursprung
Commit
e59ccc8c1f
3 geänderte Dateien mit 17 neuen und 11 gelöschten Zeilen
  1. 15 9
      model/model.py
  2. 1 1
      model/operations
  3. 1 1
      wrappers/modelverse_SCCD.py

+ 15 - 9
model/model.py

@@ -723,12 +723,18 @@ with open("calibration/averages", 'r') as param_file:
         op = op.strip()
         op = op.strip()
         args[op] = float(t)
         args[op] = float(t)
 
 
-model = System(**args)
-sim = Simulator(model)
-sim.setTerminationCondition(lambda t, m: m.mvi.state.finished)
-#sim.setVerbose()
-start = time.time()
-tn = sim.simulate()
-
-print("Simulation time %s" % tn)
-print("Execution time %s" % (time.time() - start))
+def simulate(supplied_args):
+    local_args = dict(args)
+    local_args.update(supplied_args)
+    model = System(**local_args)
+    sim = Simulator(model)
+    sim.setTerminationCondition(lambda t, m: m.mvi.state.finished)
+    #sim.setVerbose()
+    start = time.time()
+    tn = sim.simulate()
+    return (tn, time.time() - start)
+
+if __name__ == "__main__":
+    ts, te = simulate({})
+    print("Simulation time %s" % ts)
+    print("Execution time %s" % te)

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
model/operations


+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Thu Jan  4 15:09:18 2018
+Date:   Thu Jan  4 15:47:25 2018
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server