NodeNameType
- The datatype used for node names in the graph being
walkedpublic static class GraphWalker.RandomWalker<NodeNameType> extends java.lang.Object implements GraphWalker.NextNodeSelector<NodeNameType>
Constructor and Description |
---|
RandomWalker(boolean directed,
java.util.Random r)
Creates a random walker with directedness specified
|
Modifier and Type | Method and Description |
---|---|
int |
getNextNode(int lastNodeId,
int curNodeId,
GraphMetrics<NodeNameType> metrics)
Returns the id of the next node to visit based on current state
|
public RandomWalker(boolean directed, java.util.Random r)
directed
- If true, this follows only edges which originate at
the current noder
- The instance of random to use hereinpublic int getNextNode(int lastNodeId, int curNodeId, GraphMetrics<NodeNameType> metrics)
getNextNode
in interface GraphWalker.NextNodeSelector<NodeNameType>
lastNodeId
- The last node visitedcurNodeId
- The node presently visitingmetrics
- The metrics for the graph being walked