public static class PopularityWalker.Builder<T extends SequenceElement> extends RandomWalker.Builder<T>
Modifier and Type | Field and Description |
---|---|
protected PopularityMode |
popularityMode |
protected SpreadSpectrum |
spectrum |
protected int |
spread |
alpha, noEdgeHandling, seed, sourceGraph, walkDirection, walkLength
Modifier and Type | Method and Description |
---|---|
PopularityWalker<T> |
build()
This method builds PopularityWalker object with previously specified params
|
PopularityWalker.Builder<T> |
setNoEdgeHandling(NoEdgeHandling handling)
This method defines walker behavior when it gets to node which has no next nodes available
Default value: RESTART_ON_DISCONNECTED
|
PopularityWalker.Builder<T> |
setPopularityMode(PopularityMode popularityMode)
This method defines which nodes should be taken in account when choosing next hope: maximum popularity, lowest popularity, or average popularity.
|
PopularityWalker.Builder<T> |
setPopularitySpread(int topN)
This method defines, how much nodes should take place in next hop selection.
|
PopularityWalker.Builder<T> |
setRestartProbability(double alpha)
This method defines a chance for walk restart
Good value would be somewhere between 0.03-0.07
|
PopularityWalker.Builder<T> |
setSeed(long seed)
This method specifies random seed.
|
PopularityWalker.Builder<T> |
setSpreadSpectrum(SpreadSpectrum spectrum)
This method allows you to define, if nodes within popularity spread should have equal chances to be picked for next hop, or they should have chances proportional to their popularity.
|
PopularityWalker.Builder<T> |
setWalkDirection(WalkDirection direction)
This method defines next hop selection within walk
|
PopularityWalker.Builder<T> |
setWalkLength(int walkLength)
This method specifies output sequence (walk) length
|
protected PopularityMode popularityMode
protected int spread
protected SpreadSpectrum spectrum
public PopularityWalker.Builder<T> setPopularityMode(@NonNull PopularityMode popularityMode)
popularityMode
- public PopularityWalker.Builder<T> setPopularitySpread(int topN)
topN
- public PopularityWalker.Builder<T> setSpreadSpectrum(@NonNull SpreadSpectrum spectrum)
spectrum
- public PopularityWalker.Builder<T> setNoEdgeHandling(@NonNull NoEdgeHandling handling)
setNoEdgeHandling
in class RandomWalker.Builder<T extends SequenceElement>
handling
- public PopularityWalker.Builder<T> setSeed(long seed)
setSeed
in class RandomWalker.Builder<T extends SequenceElement>
seed
- public PopularityWalker.Builder<T> setWalkDirection(@NonNull WalkDirection direction)
setWalkDirection
in class RandomWalker.Builder<T extends SequenceElement>
direction
- public PopularityWalker.Builder<T> setWalkLength(int walkLength)
setWalkLength
in class RandomWalker.Builder<T extends SequenceElement>
walkLength
- public PopularityWalker.Builder<T> setRestartProbability(double alpha)
setRestartProbability
in class RandomWalker.Builder<T extends SequenceElement>
alpha
- public PopularityWalker<T> build()
build
in class RandomWalker.Builder<T extends SequenceElement>