Examples of VertexWithRankAndDangling


Examples of eu.stratosphere.test.iterative.nephele.customdanglingpagerank.types.VertexWithRankAndDangling

    if (!currentPageRankIterator.hasNext()) {
      long missingVertex = partialRanks.next().getVertexID();
      throw new IllegalStateException("No current page rank for vertex [" + missingVertex + "]!");
    }

    VertexWithRankAndDangling currentPageRank = currentPageRankIterator.next();

    long edges = 0;
    double summedRank = 0;
    while (partialRanks.hasNext()) {
      summedRank += partialRanks.next().getRank();
      edges++;
    }

    double rank = BETA * summedRank + dampingFactor + danglingRankFactor;

    double currentRank = currentPageRank.getRank();
    boolean isDangling = currentPageRank.isDangling();

    double danglingRankToAggregate = isDangling ? rank : 0;
    long danglingVerticesToAggregate = isDangling ? 1 : 0;

    double diff = Math.abs(currentRank - rank);

    aggregator.aggregate(diff, rank, danglingRankToAggregate, danglingVerticesToAggregate, 1, edges, summedRank, 0);

    accumulator.setVertexID(currentPageRank.getVertexID());
    accumulator.setRank(rank);
    accumulator.setDangling(isDangling);

    collector.collect(accumulator);
  }
View Full Code Here

Examples of org.apache.flink.test.iterative.nephele.customdanglingpagerank.types.VertexWithRankAndDangling

    if (!currentPageRankIterator.hasNext()) {
      long missingVertex = partialRanks.iterator().next().getVertexID();
      throw new IllegalStateException("No current page rank for vertex [" + missingVertex + "]!");
    }

    VertexWithRankAndDangling currentPageRank = currentPageRankIterator.next();

    long edges = 0;
    double summedRank = 0;
    for (VertexWithRank pr :partialRanks) {
      summedRank += pr.getRank();
      edges++;
    }

    double rank = BETA * summedRank + dampingFactor + danglingRankFactor;

    double currentRank = currentPageRank.getRank();
    boolean isDangling = currentPageRank.isDangling();

    double danglingRankToAggregate = isDangling ? rank : 0;
    long danglingVerticesToAggregate = isDangling ? 1 : 0;

    double diff = Math.abs(currentRank - rank);

    aggregator.aggregate(diff, rank, danglingRankToAggregate, danglingVerticesToAggregate, 1, edges, summedRank, 0);

    accumulator.setVertexID(currentPageRank.getVertexID());
    accumulator.setRank(rank);
    accumulator.setDangling(isDangling);

    collector.collect(accumulator);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.