Skip to content

Commit

Permalink
Rename "iterations" to "maxIterations" where appropriate.
Browse files Browse the repository at this point in the history
  • Loading branch information
greghogan committed May 9, 2016
1 parent 51fbca3 commit 0a961e0
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
* This algorithm can be configured to terminate either by a limit on the number
* of iterations, a convergence threshold, or both.
*
* This algorithm returns a set of {@link Tuple3} containing the vertex ID,
* the vertex's hub score, and the vertex's authority score.
*
* @param <K> graph ID type
* @param <VV> vertex value type
* @param <EV> edge value type
Expand All @@ -73,7 +70,7 @@ public class HITS<K, VV, EV>
private static final String SUM_OF_AUTHORITY_SQUARED = "sum of authority squared";

// Required configuration
private int iterations = Integer.MAX_VALUE;
private int maxIterations = Integer.MAX_VALUE;

private double convergenceThreshold;

Expand All @@ -83,7 +80,7 @@ public class HITS<K, VV, EV>
/**
* Hyperlink-Induced Topic Search with a fixed number of iterations.
*
* @param iterations number of iterations
* @param iterations fixed number of iterations
*/
public HITS(int iterations) {
this(iterations, Double.MAX_VALUE);
Expand All @@ -106,14 +103,14 @@ public HITS(double convergenceThreshold) {
* of iterations or when the total change in hub and authority scores over all
* vertices falls below the given threshold value.
*
* @param iterations number of iterations
* @param maxIterations maximum number of iterations
* @param convergenceThreshold convergence threshold for sum of scores
*/
public HITS(int iterations, double convergenceThreshold) {
Preconditions.checkArgument(iterations > 0, "Number of iterations must be greater than zero");
public HITS(int maxIterations, double convergenceThreshold) {
Preconditions.checkArgument(maxIterations > 0, "Number of iterations must be greater than zero");
Preconditions.checkArgument(convergenceThreshold > 0.0, "Convergence threshold must be greater than zero");

this.iterations = iterations;
this.maxIterations = maxIterations;
this.convergenceThreshold = convergenceThreshold;
}

Expand Down Expand Up @@ -149,7 +146,7 @@ public DataSet<Result<K>> run(Graph<K, VV, EV> input)
.name("Sum");

IterativeDataSet<Tuple3<K, DoubleValue, DoubleValue>> iterative = initialScores
.iterate(iterations);
.iterate(maxIterations);

// ID, hubbiness
DataSet<Tuple2<K, DoubleValue>> hubbiness = iterative
Expand Down Expand Up @@ -515,7 +512,7 @@ public Result<T> map(Tuple3<T, DoubleValue, DoubleValue> value) throws Exception
* @param <T> ID type
*/
public static class Result<T>
extends Vertex<T, Tuple2<DoubleValue, DoubleValue>> {
extends Vertex<T, Tuple2<DoubleValue, DoubleValue>> {
public static final int HASH_SEED = 0xc7e39a63;

public Result() {
Expand Down

0 comments on commit 0a961e0

Please sign in to comment.