コード例 #1
0
    public double getStatistic(NetworkData nd) {
      double sum = 0.0;
      int relCt = nd.getRelationCount();
      for (int ri = 0; ri < relCt; ri++) {
        switch (params.type) {
          case TYPE_EXPANSIVENESS:
            sum += nd.getOutDegreeCentrality(ri, actorIdx);
            break;

          case TYPE_ATTRACTIVENESS:
            sum += nd.getInDegreeCentrality(ri, actorIdx);
            break;

          default:
            sum = Double.NaN;
        }
      }
      return sum;
    }
コード例 #2
0
 public NetworkMeasure[] newInstances(NetworkData nd) {
   // get blockmodel
   int nSize = nd.getSize();
   NetworkMeasure[] instances = new NetworkMeasure[nSize];
   MeasureParams params = new MeasureParams(TYPE_EXPANSIVENESS);
   for (int i = 0; i < nSize; i++) {
     instances[i] = new IndividualMeasure(params, i);
   }
   return instances;
 }