@Override public double findEntropy() { double sum = 0; for (Double aDouble : ipSizeMap.values()) { sum += aDouble; } double output = 0; for (Double aDouble : ipSizeMap.values()) { output += aDouble / sum * Math.log(sum / aDouble); } numWriter.println(step + "," + ipSizeMap.size()); step++; return output; }
@Override public void finish(FinishPacket p) { super.finish(p); numWriter.close(); }