You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit adds a pseudo real time environment with the ability to switch between real time and virtual time. Furthermore, it adds a test that shows the general idea. When switching from virtual time to real time, the remaining time of following events is delayed. A factor can be used to scale real time execution times.
if(!_stopRequested&&!stopEvent.IsTriggered)thrownewInvalidOperationException("No scheduled events left but \"until\" event was not triggered.");
215
+
if(!_stop.IsCancellationRequested&&!stopEvent.IsTriggered)thrownewInvalidOperationException("No scheduled events left but \"until\" event was not triggered.");
214
216
returnstopEvent.Value;
215
217
}
216
218
217
219
publicvirtualvoidStopAsync(){
218
-
_stopRequested=true;
220
+
_stop?.Cancel();
219
221
}
220
222
221
223
publiceventEventHandlerRunStarted;
@@ -786,7 +788,7 @@ public override void Schedule(TimeSpan delay, Event @event, int priority = 0) {
786
788
/// <param name="stopEvent">The event that stops the simulation.</param>
if(!_stopRequested&&!stopEvent.IsTriggered)thrownewInvalidOperationException("No scheduled events left but \"until\" event was not triggered.");
814
+
if(!_stop.IsCancellationRequested&&!stopEvent.IsTriggered)thrownewInvalidOperationException("No scheduled events left but \"until\" event was not triggered.");
813
815
returnstopEvent.Value;
814
816
}
815
817
@@ -855,6 +857,72 @@ public override DateTime Peek() {
0 commit comments