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