summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-compute/src/main/java/org
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2025-01-10 15:10:31 +0100
committerGitHub <noreply@github.com>2025-01-10 15:10:31 +0100
commit39aeb8e07d640fee5e3ba1b4d64eb3a3a964648b (patch)
treea06a54109519edf3b63c4618cd8187f6d63a1de1 /opendc-simulator/opendc-simulator-compute/src/main/java/org
parent192ca10f332c58d38d129709c64dd69c284683f5 (diff)
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
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute/src/main/java/org')
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/power/SimPowerSource.java2
1 files changed, 2 insertions, 0 deletions
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);
}