From: Daniel Kirschten Date: Wed, 22 May 2019 10:08:20 +0000 (+0200) Subject: Changed executeNext; added comment about timeout X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=b81f1118975e7b359314150e5b9c73e3c0d68d8d;hp=be8e8e6cbb22aebfe729b79d6d327dc07428e256;p=Mograsim.git Changed executeNext; added comment about timeout --- 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 */