@@ -25,13 +25,20 @@ class SimDriver {
2525 NetworkModel model = new NetworkModel (null ," SMOL Simulation Engine" ,true ,true , varList)
2626 Experiment exp = new Experiment (" SMOLSimulationExperiment" , new SingleUnitTimeFormatter (referenceUnit, epsilon,6 ,false ))
2727
28- model. connectToExperiment(exp)
29- exp. stop(new TimeInstant (10000 , TimeUnit . MILLISECONDS ));
30-
28+ def simObject = (Map<String ,String > )new GraphProducer (). parseSimObject(properties)
29+ def simTime = Double . parseDouble(simObject. getOrDefault(" simTime" ," " ))
3130
32- exp. tracePeriod(new TimeInstant (0 ), new TimeInstant (10000 ,TimeUnit . MILLISECONDS ));
33- exp. debugPeriod(new TimeInstant (0 ), new TimeInstant (10000 ,TimeUnit . MILLISECONDS ));
31+ model. connectToExperiment(exp)
3432
33+ if (simTime != 0 ) {
34+ exp. stop(new TimeInstant (simTime, TimeUnit . MILLISECONDS ));
35+ exp. tracePeriod(new TimeInstant (0 ), new TimeInstant (simTime, TimeUnit . MILLISECONDS ));
36+ exp. debugPeriod(new TimeInstant (0 ), new TimeInstant (simTime, TimeUnit . MILLISECONDS ));
37+ }else {
38+ exp. stop(new TimeInstant (1000 , TimeUnit . MILLISECONDS ));
39+ exp. tracePeriod(new TimeInstant (0 ), new TimeInstant (1000 , TimeUnit . MILLISECONDS ));
40+ exp. debugPeriod(new TimeInstant (0 ), new TimeInstant (1000 , TimeUnit . MILLISECONDS ));
41+ }
3542
3643 LogsWritrer lw = new LogsWritrer ()
3744 exp. register(lw)
@@ -40,10 +47,8 @@ class SimDriver {
4047 exp. setShowProgressBarAutoclose(true )
4148 exp. setShowProgressBar(true )
4249
43-
4450 exp. start()
4551 exp. report()
46-
4752 exp. finish()
4853 }
4954}
0 commit comments