コード例 #1
0
 /**
  * gets the vertices in this cluster
  *
  * @return
  */
 public Collection<String> getVertexIds() {
   ArrayList<String> ids = new ArrayList<String>();
   for (SemiClusteringVertex v : getVertices()) {
     ids.add(v.getVertexID());
   }
   return (Collection) ids;
 }
コード例 #2
0
  public void readFields(DataInput in) throws IOException {
    if (in.readBoolean()) {
      this.semiClusterId = in.readUTF();
    }
    this.semiClusterScore = in.readDouble();

    if (in.readBoolean()) {
      int len = in.readInt();
      if (len > 0) {
        for (int i = 0; i < len; i++) {
          SemiClusteringVertex v = new SemiClusteringVertex();
          v.readFields(in);
          semiClusterVertexList.add(v);
        }
      }
    }
    int len = in.readInt();
    if (len > 0) {
      for (int i = 0; i < len; i++) {
        SemiClusterDetails sd = new SemiClusterDetails();
        sd.readFields(in);
        semiClusterContainThis.add(sd);
      }
    }
  }
コード例 #3
0
 public int getInternalWeight() {
   int internalWeight = 0;
   for (SemiClusteringVertex v : getVertices()) {
     for (Edge<IntWritable> e : v.getEdges()) {
       if (getVertexIds().contains(e.getDestinationVertex()))
         internalWeight += e.getEdgeValue().get();
     }
   }
   return internalWeight;
 }