diff --git a/src/ConsensusStatsFileHandler.java b/src/ConsensusStatsFileHandler.java index 99cb4de..be059c3 100644 --- a/src/ConsensusStatsFileHandler.java +++ b/src/ConsensusStatsFileHandler.java @@ -65,8 +65,10 @@ public class ConsensusStatsFileHandler { SortedMap csAggr = new TreeMap(); while (it.hasNext() || !haveWrittenFinalLine) { String next = it.hasNext() ? it.next() : null; - if (tempDate != null && (next == null || - !next.substring(0, 10).equals(tempDate))) { + if (tempDate != null + && (next == null || !next.substring(0, 10).equals(tempDate)) + && consensusesDay > 0) { +// TODO set threshold of 12 (of 24 possible) here? csAggr.put(tempDate, tempDate + "," + (exitDay / consensusesDay) + "," + (fastDay / consensusesDay) + "," @@ -107,8 +109,10 @@ public class ConsensusStatsFileHandler { SortedMap bcsAggr = new TreeMap(); while (it.hasNext() || !haveWrittenFinalLine) { String next = it.hasNext() ? it.next() : null; - if (tempDate != null && (next == null || - !next.substring(0, 10).equals(tempDate))) { + if (tempDate != null + && (next == null || !next.substring(0, 10).equals(tempDate)) + && bridgeStatusesDay > 0) { +// TODO set threshold of 24 (of 48 possible) here? bcsAggr.put(tempDate, "" + (brunningDay / bridgeStatusesDay) + "\n"); brunningDay = 0; bridgeStatusesDay = 0;