summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-flow/src/main/java/org
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2025-02-03 13:11:48 +0100
committerGitHub <noreply@github.com>2025-02-03 13:11:48 +0100
commitdf1028c71cb6d50db886c8076c7139ec24feb6d7 (patch)
tree9ab240a87df720d5eec588027c84a4d614bb4394 /opendc-simulator/opendc-simulator-flow/src/main/java/org
parentf471d06e842f3675b634c4ceceb108cfd8817837 (diff)
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
Diffstat (limited to 'opendc-simulator/opendc-simulator-flow/src/main/java/org')
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java4
1 files changed, 3 insertions, 1 deletions
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) {