From f55aaed2d41388712ec0cc90055831dae5d57896 Mon Sep 17 00:00:00 2001 From: Dante Niewenhuis Date: Thu, 12 Dec 2024 09:03:28 +0100 Subject: Solved a small bug that let FlowNodes update while they are in a closed state. (#283) --- .../src/main/java/org/opendc/simulator/engine/graph/FlowNode.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'opendc-simulator/opendc-simulator-flow/src/main') diff --git a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowNode.java b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowNode.java index 6ee947bc..b2827130 100644 --- a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowNode.java +++ b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowNode.java @@ -157,6 +157,11 @@ public abstract class FlowNode { * Update the state of the stage. */ public void update(long now) { + if (this.nodeState == NodeState.CLOSED) { + this.deadline = Long.MAX_VALUE; + return; + } + this.nodeState = NodeState.UPDATING; long newDeadline = this.deadline; -- cgit v1.2.3