From 39aeb8e07d640fee5e3ba1b4d64eb3a3a964648b Mon Sep 17 00:00:00 2001 From: Dante Niewenhuis Date: Fri, 10 Jan 2025 15:10:31 +0100 Subject: Fixed a small bug in the Power Source (#289) * Fixed a small bug which caused the PowerSource to not always report the correct energy usage * spotless --- .../main/java/org/opendc/simulator/compute/power/SimPowerSource.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'opendc-simulator') diff --git a/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/power/SimPowerSource.java b/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/power/SimPowerSource.java index d2270888..f68c008e 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/power/SimPowerSource.java +++ b/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/power/SimPowerSource.java @@ -168,6 +168,8 @@ public final class SimPowerSource extends FlowNode implements FlowSupplier { @Override public void pushOutgoingSupply(FlowEdge consumerEdge, double newSupply) { + updateCounters(); + this.powerSupplied = newSupply; consumerEdge.pushSupply(newSupply); } -- cgit v1.2.3