diff options
| author | Dante Niewenhuis <d.niewenhuis@hotmail.com> | 2025-07-22 15:47:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-22 15:47:44 +0200 |
| commit | e22c97dcca7478d6941b78bdf7cd873bc0d23cdc (patch) | |
| tree | f1859c16f4c7973d8b16ed693caad4c749d42331 /opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc | |
| parent | 0c0cf25616771cd40a9e401edcba4a5e5016f76e (diff) | |
Updated workload schema (#360)
Diffstat (limited to 'opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc')
2 files changed, 4 insertions, 6 deletions
diff --git a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowDistributor.java b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowDistributor.java index c388293b..501bbf10 100644 --- a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowDistributor.java +++ b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowDistributor.java @@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory; * It also provides methods to update outgoing demands and supplies based on the incoming demands and supplies. * This class is abstract and should be extended by specific implementations that define the distribution strategy. * It uses a {@link FlowDistributorFactory.DistributionPolicy} to determine how to distribute the supply among the consumers. - * The default distribution policy is {@link MaxMinFairnessPolicy}, which distributes the supply fairly among the consumers. + * The default distribution policy is MaxMinFairnessPolicy, which distributes the supply fairly among the consumers. */ public abstract class FlowDistributor extends FlowNode implements FlowSupplier, FlowConsumer { protected static final Logger LOGGER = LoggerFactory.getLogger(FlowDistributor.class); @@ -178,7 +178,9 @@ public abstract class FlowDistributor extends FlowNode implements FlowSupplier, // supplierIndex not always set, so we use 0 as default to avoid index out of bounds int idx = supplierEdge.getSupplierIndex() == -1 ? 0 : supplierEdge.getSupplierIndex(); // to keep index consistent, entries are neutralized instead of removed - this.supplierEdges.put(idx, null); + // this.supplierEdges.put(idx, null); + + this.supplierEdges.remove(idx); this.capacity -= supplierEdge.getCapacity(); this.currentIncomingSupplies.put(idx, 0.0); diff --git a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/distributionPolicies/MaxMinFairnessFlowDistributor.java b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/distributionPolicies/MaxMinFairnessFlowDistributor.java index 9b48f204..371015a4 100644 --- a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/distributionPolicies/MaxMinFairnessFlowDistributor.java +++ b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/distributionPolicies/MaxMinFairnessFlowDistributor.java @@ -44,12 +44,8 @@ public class MaxMinFairnessFlowDistributor extends FlowDistributor { } protected void updateOutgoingDemand() { - // equally distribute the demand to all suppliers for (FlowEdge supplierEdge : this.supplierEdges.values()) { this.pushOutgoingDemand(supplierEdge, this.totalIncomingDemand / this.supplierEdges.size()); - // alternatively a relative share could be used, based on capacity minus current incoming supply - // this.pushOutgoingDemand(supplierEdge, this.totalIncomingDemand * (supplierEdge.getCapacity() - - // currentIncomingSupplies.get(idx) / supplierEdges.size())); } this.outgoingDemandUpdateNeeded = false; |
