diff options
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/Multiplexer.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/Multiplexer.java b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/Multiplexer.java index a87ded8d..25dc564f 100644 --- a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/Multiplexer.java +++ b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/Multiplexer.java @@ -130,6 +130,8 @@ public class Multiplexer extends FlowNode implements FlowSupplier, FlowConsumer this.consumerEdges.add(consumerEdge); this.demands.add(0.0); this.supplies.add(0.0); + + this.invalidate(); } @Override @@ -137,6 +139,8 @@ public class Multiplexer extends FlowNode implements FlowSupplier, FlowConsumer this.supplierEdge = supplierEdge; this.capacity = supplierEdge.getCapacity(); this.totalSupply = 0; + + this.invalidate(); } @Override @@ -176,15 +180,12 @@ public class Multiplexer extends FlowNode implements FlowSupplier, FlowConsumer demands.set(idx, newDemand); this.totalDemand += (newDemand - prevDemand); + this.invalidate(); } @Override public void handleSupply(FlowEdge supplierEdge, double newSupply) { - if (newSupply == this.totalSupply) { - return; - } - - this.totalSupply = newSupply; + this.invalidate(); } @Override |
