code: public double getAverageKamNodeOutDegree(String kamName) {
          final int nodes = getKamNodeCount(kamName);
          return (nodes != 0 ? ((double) getKamEdgeCount(kamName)) / nodes : 0.0);
      }
docs: Returns the average KAM node out degree.
  
  Zero is returned if the average is undefined (in case
  the number of KAM nodes is zero).