summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-flow/src
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-simulator/opendc-simulator-flow/src')
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt
index c6aa94e2..97059e93 100644
--- a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt
@@ -327,6 +327,9 @@ public class MaxMinFlowMultiplexer(
for (input in _activeInputs) {
input.capacity = newCapacity
}
+
+ // Sort outputs by their capacity
+ _activeOutputs.sort()
}
/**
@@ -408,9 +411,6 @@ public class MaxMinFlowMultiplexer(
this.demand = demand
this.rate = rate
- // Sort all consumers by their capacity
- activeOutputs.sort()
-
// Divide the requests over the available capacity of the input resources fairly
for (i in activeOutputs.indices) {
val output = activeOutputs[i]