Пример #1
0
 @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;
 }
Пример #2
0
 @Override
 public void finish(FinishPacket p) {
   super.finish(p);
   numWriter.close();
 }