X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=era.mi%2Fsrc%2Fera%2Fmi%2Flogic%2Ftimeline%2FTimeline.java;h=48b0f958f3ad48cc2a851fd4da7988a9c611a4c5;hb=b81f1118975e7b359314150e5b9c73e3c0d68d8d;hp=8107db9627d1d70034db863a4da738a4cf647a0c;hpb=be8e8e6cbb22aebfe729b79d6d327dc07428e256;p=Mograsim.git 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 */