use of org.neo4j.graphdb.traversal.PathEvaluator in project neo4j by neo4j.
the class Dijkstra method traverser.
private Traverser traverser(Node start, final Node end, PathInterest<Double> interest) {
PathExpander dijkstraExpander;
PathEvaluator dijkstraEvaluator;
if (stateInUse) {
dijkstraExpander = expander;
dijkstraEvaluator = Evaluators.includeWhereEndNodeIs(end);
} else {
MutableDouble shortestSoFar = new MutableDouble(Double.MAX_VALUE);
dijkstraExpander = new DijkstraPathExpander(expander, shortestSoFar, epsilon, interest.stopAfterLowestCost());
dijkstraEvaluator = new DijkstraEvaluator(shortestSoFar, end, costEvaluator);
}
lastTraverser = new MonoDirectionalTraversalDescription().uniqueness(Uniqueness.NODE_PATH).expand(dijkstraExpander, stateFactory).order(new DijkstraSelectorFactory(interest, costEvaluator)).evaluator(dijkstraEvaluator).traverse(start);
return lastTraverser;
}
Aggregations