Package org.nlpub.watset.graph
Class ChineseWhispers.Builder<V,E>
- java.lang.Object
-
- org.nlpub.watset.graph.ChineseWhispers.Builder<V,E>
-
- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph
- All Implemented Interfaces:
Function<org.jgrapht.Graph<V,E>,ChineseWhispers<V,E>>,ClusteringAlgorithmBuilder<V,E,ChineseWhispers<V,E>>
- Enclosing class:
- ChineseWhispers<V,E>
public static class ChineseWhispers.Builder<V,E> extends Object implements ClusteringAlgorithmBuilder<V,E,ChineseWhispers<V,E>>
Builder forChineseWhispers.
-
-
Field Summary
Fields Modifier and Type Field Description static intITERATIONSThe default number of Chinese Whispers iterations.
-
Constructor Summary
Constructors Constructor Description Builder()Create an instance ofChineseWhispersbuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChineseWhispers<V,E>apply(org.jgrapht.Graph<V,E> graph)ChineseWhispers.Builder<V,E>setIterations(int iterations)Set the maximal number of iterations.ChineseWhispers.Builder<V,E>setRandom(Random random)Set the random number generator.ChineseWhispers.Builder<V,E>setWeighting(NodeWeighting<V,E> weighting)Set the the node weighting approach.
-
-
-
Field Detail
-
ITERATIONS
public static final int ITERATIONS
The default number of Chinese Whispers iterations.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Builder
public Builder()
Create an instance ofChineseWhispersbuilder.
-
-
Method Detail
-
apply
public ChineseWhispers<V,E> apply(org.jgrapht.Graph<V,E> graph)
-
setWeighting
public ChineseWhispers.Builder<V,E> setWeighting(NodeWeighting<V,E> weighting)
Set the the node weighting approach.- Parameters:
weighting- the node weighting approach- Returns:
- the builder
-
setIterations
public ChineseWhispers.Builder<V,E> setIterations(int iterations)
Set the maximal number of iterations.- Parameters:
iterations- the maximal number of iterations- Returns:
- the builder
-
setRandom
public ChineseWhispers.Builder<V,E> setRandom(Random random)
Set the random number generator.- Parameters:
random- the random number generator- Returns:
- the builder
-
-