public static class RandomWalker.Builder<T extends SequenceElement>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected double |
alpha |
protected NoEdgeHandling |
noEdgeHandling |
protected long |
seed |
protected IGraph<T,?> |
sourceGraph |
protected WalkDirection |
walkDirection |
protected int |
walkLength |
Constructor and Description |
---|
Builder(IGraph<T,?> graph)
Builder constructor for RandomWalker
|
Modifier and Type | Method and Description |
---|---|
RandomWalker<T> |
build()
This method builds RandomWalker instance
|
RandomWalker.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
|
RandomWalker.Builder<T> |
setRestartProbability(double alpha)
This method defines a chance for walk restart
Good value would be somewhere between 0.03-0.07
|
RandomWalker.Builder<T> |
setSeed(long seed)
This method specifies random seed.
|
RandomWalker.Builder<T> |
setWalkDirection(WalkDirection direction)
This method defines next hop selection within walk
|
RandomWalker.Builder<T> |
setWalkLength(int walkLength)
This method specifies output sequence (walk) length
|
protected int walkLength
protected NoEdgeHandling noEdgeHandling
protected IGraph<T extends SequenceElement,?> sourceGraph
protected long seed
protected WalkDirection walkDirection
protected double alpha
public RandomWalker.Builder<T> setWalkLength(int walkLength)
walkLength
- public RandomWalker.Builder<T> setNoEdgeHandling(@NonNull NoEdgeHandling handling)
handling
- public RandomWalker.Builder<T> setSeed(long seed)
seed
- public RandomWalker.Builder<T> setWalkDirection(@NonNull WalkDirection direction)
direction
- public RandomWalker.Builder<T> setRestartProbability(double alpha)
alpha
- public RandomWalker<T> build()