Package org.graphwalker.core.generator
Class WeightedRandomPath
java.lang.Object
org.graphwalker.core.generator.PathGeneratorBase<StopCondition>
org.graphwalker.core.generator.WeightedRandomPath
- All Implemented Interfaces:
PathGenerator<StopCondition>
WeightedRandomPath
The WeightedRandomPath generator will generate a random path through a model, but will select out-edges according to probabilities. WeightedRandomPath generates a random path, but will take into accountEdge.setWeight(java.lang.Double) as
a probability. When selecting an edge from the list of all out-edges from a current vertex, the weights
of those edges are considered. For example, an edge with the weight 0.5 is given 50% chance of being selected.
- Author:
- Kristian Karl
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.graphwalker.core.generator.PathGeneratorBase
getContext, getStopCondition, setContext, setStopCondition, toString, toString
-
Constructor Details
-
WeightedRandomPath
-
-
Method Details
-
getNextStep
- Specified by:
getNextStepin interfacePathGenerator<StopCondition>- Overrides:
getNextStepin classPathGeneratorBase<StopCondition>
-
hasNextStep
public boolean hasNextStep()
-