From df1028c71cb6d50db886c8076c7139ec24feb6d7 Mon Sep 17 00:00:00 2001 From: Dante Niewenhuis Date: Mon, 3 Feb 2025 13:11:48 +0100 Subject: Added Batteries (#300) * Batteries are implemented. Small problem with the deletion when running larger workloads. Added mock files for the Battery implementation. Updated the Carbon Model to allow for multiple receivers of CarbonIntensity * Implemented batteries in OpenDC. * Spotless applied --- .../src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'opendc-simulator/opendc-simulator-flow/src') diff --git a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java index 91662950..60d57785 100644 --- a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java +++ b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java @@ -76,7 +76,7 @@ public class FlowGraph { /** * Add an edge between the specified consumer and supplier in this graph. */ - public void addEdge(FlowConsumer flowConsumer, FlowSupplier flowSupplier) { + public FlowEdge addEdge(FlowConsumer flowConsumer, FlowSupplier flowSupplier) { // Check if the consumer and supplier are both FlowNodes if (!(flowConsumer instanceof FlowNode)) { throw new IllegalArgumentException("Flow consumer is not a FlowNode"); @@ -99,6 +99,8 @@ public class FlowGraph { nodeToEdge.get((FlowNode) flowConsumer).add(flowEdge); nodeToEdge.get((FlowNode) flowSupplier).add(flowEdge); + + return flowEdge; } public void removeEdge(FlowEdge flowEdge) { -- cgit v1.2.3