From 0eabdca05c5203cc7eb4ffe0a9bc76f7fdb54058 Mon Sep 17 00:00:00 2001 From: MauveCloud Date: Fri, 23 Feb 2018 09:19:53 -0800 Subject: [PATCH] Improved consistency of efficiency calculations for an exploding reactor. --- src/Ic2ExpReactorPlanner/SimpleSimulator.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Ic2ExpReactorPlanner/SimpleSimulator.java b/src/Ic2ExpReactorPlanner/SimpleSimulator.java index 4510694..650dbd9 100644 --- a/src/Ic2ExpReactorPlanner/SimpleSimulator.java +++ b/src/Ic2ExpReactorPlanner/SimpleSimulator.java @@ -141,16 +141,18 @@ protected Void doInBackground() throws Exception { } } } - lastEUoutput = reactor.getCurrentEUoutput(); - totalEUoutput += lastEUoutput; - lastHeatOutput = reactor.getVentedHeat(); - totalHeatOutput += lastHeatOutput; - if (reactor.getCurrentHeat() <= reactor.getMaxHeat() && lastEUoutput > 0.0) { - reactorTicks++; - minEUoutput = Math.min(lastEUoutput, minEUoutput); - maxEUoutput = Math.max(lastEUoutput, maxEUoutput); - minHeatOutput = Math.min(lastHeatOutput, minHeatOutput); - maxHeatOutput = Math.max(lastHeatOutput, maxHeatOutput); + if (reactor.getCurrentHeat() <= reactor.getMaxHeat()) { + lastEUoutput = reactor.getCurrentEUoutput(); + totalEUoutput += lastEUoutput; + lastHeatOutput = reactor.getVentedHeat(); + totalHeatOutput += lastHeatOutput; + if (lastEUoutput > 0.0) { + reactorTicks++; + minEUoutput = Math.min(lastEUoutput, minEUoutput); + maxEUoutput = Math.max(lastEUoutput, maxEUoutput); + minHeatOutput = Math.min(lastHeatOutput, minHeatOutput); + maxHeatOutput = Math.max(lastHeatOutput, maxHeatOutput); + } } for (int row = 0; row < 6; row++) { for (int col = 0; col < 9; col++) {