From 4991db239e3a8b0a985dbed335907e2d38306d22 Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Wed, 22 May 2019 12:08:20 +0200 Subject: [PATCH] Changed executeNext; added comment about timeout --- era.mi/src/era/mi/logic/timeline/Timeline.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/era.mi/src/era/mi/logic/timeline/Timeline.java b/era.mi/src/era/mi/logic/timeline/Timeline.java index 8107db96..48b0f958 100644 --- a/era.mi/src/era/mi/logic/timeline/Timeline.java +++ b/era.mi/src/era/mi/logic/timeline/Timeline.java @@ -38,9 +38,9 @@ public class Timeline public void executeNext() { - InnerEvent first = events.poll(); - currentTime = first.getTiming(); - first.run(); + InnerEvent first = events.peek(); + if (first != null) + executeUpTo(first.getTiming(), -1); } public void executeAll() @@ -53,7 +53,7 @@ public class Timeline * Executes all events up to a given simulation timestamp. The simulation process can be constrained by a real world timestamp. * * @param timestamp the simulation timestamp up to which the events will be processed - * @param stopMillis the System.currentTimeMillis() when simulation definitely needs to stop. + * @param stopMillis the System.currentTimeMillis() when simulation definitely needs to stop. A value of -1 means no timeout. * @return if it was possible to fulfil the goal in the given real world time. * @author Christian Femers */ -- 2.17.1